]> git.ipfire.org Git - ipfire.org.git/blobdiff - src/backend/base.py
Add bot that automatically tweets some things
[ipfire.org.git] / src / backend / base.py
index 2452eff7a8995619f3678cfcefba14383ac0d752..6c79d8bf44406e4de7d85241b107a6ebabe1ef42 100644 (file)
@@ -5,21 +5,23 @@ import io
 import tornado.gen
 
 from . import accounts
+from . import blog
 from . import database
 from . import geoip
 from . import fireinfo
 from . import iuse
 from . import memcached
+from . import messages
 from . import mirrors
 from . import netboot
 from . import nopaste
 from . import releases
 from . import settings
 from . import talk
-
-from . import blog
+from . import tweets
 from . import wiki
 from . import zeiterfassung
+from .decorators import *
 
 DEFAULT_CONFIG = io.StringIO("""
 [global]
@@ -87,6 +89,11 @@ class Backend(object):
        @tornado.gen.coroutine
        def run_task(self, task, *args, **kwargs):
                tasks = {
+                       "check-mirrors"     : self.mirrors.check_all,
+                       "cleanup-messages"  : self.messages.queue.cleanup,
+                       "scan-files"        : self.releases.scan_files,
+                       "send-all-messages" : self.messages.queue.send_all,
+                       "tweet"             : self.tweets.tweet,
                        "update-blog-feeds" : self.blog.update_feeds,
                }
 
@@ -102,3 +109,11 @@ class Backend(object):
                # we will end the program
                if r:
                        raise SystemExit(r)
+
+       @lazy_property
+       def messages(self):
+               return messages.Messages(self)
+
+       @lazy_property
+       def tweets(self):
+               return tweets.Tweets(self)