Skip to content

Commit

Permalink
Remove pywws.totwitter module
Browse files Browse the repository at this point in the history
The new pywws.service.twitter is simpler and more flexible.

Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
  • Loading branch information
jim-easterbrook committed Aug 23, 2018
1 parent 01fe824 commit 126c231
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 290 deletions.
4 changes: 2 additions & 2 deletions src/pywws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '18.8.0'
_release = '1579'
_commit = 'ae83eab'
_release = '1580'
_commit = '01fe824'
17 changes: 0 additions & 17 deletions src/pywws/regulartasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def __init__(self, context):
os.makedirs(self.uploads_directory)
# delay creation of uploader object until we know it's needed
self.uploader = None
# delay creation of a Twitter object until we know it's needed
self.twitter = None
# get daytime end hour
self.day_end_hour, self.use_dst = pywws.process.get_day_end_hour(
self.params)
Expand Down Expand Up @@ -187,9 +185,6 @@ def _do_common(self, now, sections, live_data=None):
self.do_plot(template, local='L' in flags)
# do text templates
for template, flags in text_tasks:
if 'T' in flags:
self.do_twitter(template, live_data)
continue
self.do_template(template, data=live_data, local='L' in flags)
# do service tasks
for name in self.services:
Expand Down Expand Up @@ -275,21 +270,9 @@ def do_tasks(self):
# cleanly shut down upload threads
for name in self.services:
self.services[name].stop()
if self.twitter:
self.twitter.stop()
if self.uploader:
self.uploader.stop()

def do_twitter(self, template, data=None):
if not self.twitter:
import pywws.totwitter
self.twitter = pywws.totwitter.ToTwitter(self.context)
logger.info("Templating %s", template)
input_file = os.path.join(self.template_dir, template)
tweet = self.templater.make_text(input_file, live_data=data)
logger.info("Tweeting")
self.twitter.upload(tweet)

def do_plot(self, template, local=False):
logger.info("Graphing %s", template)
input_file = os.path.join(self.graph_template_dir, template)
Expand Down
271 changes: 0 additions & 271 deletions src/pywws/totwitter.py

This file was deleted.

0 comments on commit 126c231

Please sign in to comment.