summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2015-12-11 00:39:12 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2015-12-11 00:58:02 +0200
commitbecaea0b26b0688df6d3b82dcb744d2b5d73e549 (patch)
tree1d391275d1b153248d1c412118112098928763d8 /examples
parent8a6cb05863001e1c62b369dbbafda4c1aa353366 (diff)
downloadapscheduler-becaea0b26b0688df6d3b82dcb744d2b5d73e549.tar.gz
Improved PEP 8 and PEP 257 compliancy
Moved from the previous 120 column limit to PEP 8 compliant 99 column limit.
Diffstat (limited to 'examples')
-rw-r--r--examples/jobstores/mongodb.py4
-rw-r--r--examples/jobstores/redis_.py4
-rw-r--r--examples/jobstores/sqlalchemy_.py5
-rw-r--r--examples/schedulers/asyncio_.py3
-rw-r--r--examples/schedulers/background.py6
-rw-r--r--examples/schedulers/blocking.py3
-rw-r--r--examples/schedulers/gevent_.py3
-rw-r--r--examples/schedulers/qt.py8
-rw-r--r--examples/schedulers/tornado_.py3
-rw-r--r--examples/schedulers/twisted_.py3
10 files changed, 27 insertions, 15 deletions
diff --git a/examples/jobstores/mongodb.py b/examples/jobstores/mongodb.py
index daf07ae..22ee6c7 100644
--- a/examples/jobstores/mongodb.py
+++ b/examples/jobstores/mongodb.py
@@ -1,8 +1,8 @@
"""
This example demonstrates the use of the MongoDB job store.
On each run, it adds a new alarm that fires after ten seconds.
-You can exit the program, restart it and observe that any previous alarms that have not fired yet are still active.
-Running the example with the --clear switch will remove any existing alarms.
+You can exit the program, restart it and observe that any previous alarms that have not fired yet
+are still active. Running the example with the --clear switch will remove any existing alarms.
"""
from datetime import datetime, timedelta
diff --git a/examples/jobstores/redis_.py b/examples/jobstores/redis_.py
index 169bcc1..0f24183 100644
--- a/examples/jobstores/redis_.py
+++ b/examples/jobstores/redis_.py
@@ -1,8 +1,8 @@
"""
This example demonstrates the use of the Redis job store.
On each run, it adds a new alarm that fires after ten seconds.
-You can exit the program, restart it and observe that any previous alarms that have not fired yet are still active.
-Running the example with the --clear switch will remove any existing alarms.
+You can exit the program, restart it and observe that any previous alarms that have not fired yet
+are still active. Running the example with the --clear switch will remove any existing alarms.
"""
from datetime import datetime, timedelta
diff --git a/examples/jobstores/sqlalchemy_.py b/examples/jobstores/sqlalchemy_.py
index 4db4e9c..83e987b 100644
--- a/examples/jobstores/sqlalchemy_.py
+++ b/examples/jobstores/sqlalchemy_.py
@@ -1,8 +1,9 @@
"""
This example demonstrates the use of the SQLAlchemy job store.
On each run, it adds a new alarm that fires after ten seconds.
-You can exit the program, restart it and observe that any previous alarms that have not fired yet are still active.
-You can also give it the database URL as an argument. See the SQLAlchemy documentation on how to construct those.
+You can exit the program, restart it and observe that any previous alarms that have not fired yet
+are still active. You can also give it the database URL as an argument.
+See the SQLAlchemy documentation on how to construct those.
"""
from datetime import datetime, timedelta
diff --git a/examples/schedulers/asyncio_.py b/examples/schedulers/asyncio_.py
index a5d6373..e631b8f 100644
--- a/examples/schedulers/asyncio_.py
+++ b/examples/schedulers/asyncio_.py
@@ -1,5 +1,6 @@
"""
-Demonstrates how to use the Tornado compatible scheduler to schedule a job that executes on 3 second intervals.
+Demonstrates how to use the Tornado compatible scheduler to schedule a job that executes on 3
+second intervals.
"""
from datetime import datetime
diff --git a/examples/schedulers/background.py b/examples/schedulers/background.py
index 59a1eed..8ac1ae9 100644
--- a/examples/schedulers/background.py
+++ b/examples/schedulers/background.py
@@ -1,5 +1,6 @@
"""
-Demonstrates how to use the background scheduler to schedule a job that executes on 3 second intervals.
+Demonstrates how to use the background scheduler to schedule a job that executes on 3 second
+intervals.
"""
from datetime import datetime
@@ -24,4 +25,5 @@ if __name__ == '__main__':
while True:
time.sleep(2)
except (KeyboardInterrupt, SystemExit):
- scheduler.shutdown() # Not strictly necessary if daemonic mode is enabled but should be done if possible
+ # Not strictly necessary if daemonic mode is enabled but should be done if possible
+ scheduler.shutdown()
diff --git a/examples/schedulers/blocking.py b/examples/schedulers/blocking.py
index 31b1783..5b1ce3e 100644
--- a/examples/schedulers/blocking.py
+++ b/examples/schedulers/blocking.py
@@ -1,5 +1,6 @@
"""
-Demonstrates how to use the blocking scheduler to schedule a job that executes on 3 second intervals.
+Demonstrates how to use the blocking scheduler to schedule a job that executes on 3 second
+intervals.
"""
from datetime import datetime
diff --git a/examples/schedulers/gevent_.py b/examples/schedulers/gevent_.py
index e51e5bb..8b23402 100644
--- a/examples/schedulers/gevent_.py
+++ b/examples/schedulers/gevent_.py
@@ -1,5 +1,6 @@
"""
-Demonstrates how to use the gevent compatible scheduler to schedule a job that executes on 3 second intervals.
+Demonstrates how to use the gevent compatible scheduler to schedule a job that executes on 3 second
+intervals.
"""
from datetime import datetime
diff --git a/examples/schedulers/qt.py b/examples/schedulers/qt.py
index bc70fb3..c0ab5b5 100644
--- a/examples/schedulers/qt.py
+++ b/examples/schedulers/qt.py
@@ -1,5 +1,6 @@
"""
-Demonstrates how to use the Qt compatible scheduler to schedule a job that executes on 3 second intervals.
+Demonstrates how to use the Qt compatible scheduler to schedule a job that executes on 3 second
+intervals.
"""
from datetime import datetime
@@ -23,7 +24,10 @@ def tick():
if __name__ == '__main__':
app = QApplication(sys.argv)
- signal.signal(signal.SIGINT, lambda *args: QApplication.quit()) # This enables processing of Ctrl+C keypresses
+
+ # This enables processing of Ctrl+C keypresses
+ signal.signal(signal.SIGINT, lambda *args: QApplication.quit())
+
label = QLabel('The timer text will appear here in a moment!')
label.setWindowTitle('QtScheduler example')
label.setFixedSize(280, 50)
diff --git a/examples/schedulers/tornado_.py b/examples/schedulers/tornado_.py
index f839d0d..fe689af 100644
--- a/examples/schedulers/tornado_.py
+++ b/examples/schedulers/tornado_.py
@@ -1,5 +1,6 @@
"""
-Demonstrates how to use the Tornado compatible scheduler to schedule a job that executes on 3 second intervals.
+Demonstrates how to use the Tornado compatible scheduler to schedule a job that executes on 3
+second intervals.
"""
from datetime import datetime
diff --git a/examples/schedulers/twisted_.py b/examples/schedulers/twisted_.py
index d63f06d..46413cb 100644
--- a/examples/schedulers/twisted_.py
+++ b/examples/schedulers/twisted_.py
@@ -1,5 +1,6 @@
"""
-Demonstrates how to use the Twisted compatible scheduler to schedule a job that executes on 3 second intervals.
+Demonstrates how to use the Twisted compatible scheduler to schedule a job that executes on 3
+second intervals.
"""
from datetime import datetime