From 1b5b5298e70dccee3cbf8222c8eb7deffd0372d2 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sat, 31 Oct 2009 13:00:50 +0000 Subject: [PATCH] clean up, twitting log --- deefuzzer.py | 11 +++++------ install.py | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/deefuzzer.py b/deefuzzer.py index 8928ec3..c81ebb9 100755 --- a/deefuzzer.py +++ b/deefuzzer.py @@ -284,8 +284,10 @@ class Station(Thread): message = 'now playing: %s #%s #%s' % (self.song.replace('_', ' '), self.artist.replace(' ', ''), self.short_name) tags = '#' + ' #'.join(self.twitter_tags) message = message + ' ' + tags + message = message[:113] + ' ' + self.tinyurl message = message.decode('utf8') - self.twitter.post(message[:113] + ' ' + self.tinyurl) + self.logger.write('Twitting : "' + message + '"') + self.twitter.post(message) def update_rss(self, media_list, rss_file, sub_title): rss_item_list = [] @@ -457,8 +459,8 @@ class Station(Thread): song = str(self.current_media_obj[0].file_name) else: song = self.artist + ' : ' + self.title - self.song = str(song.encode('utf-8')) - self.artist = str(self.artist.encode('utf-8')) + self.song = song.encode('utf-8') + self.artist = self.artist.encode('utf-8') self.metadata_file = self.metadata_dir + os.sep + self.current_media_obj[0].file_name + '.xml' self.update_rss(self.current_media_obj, self.metadata_file, '') @@ -498,9 +500,6 @@ class Twitter: self.password = password self.api = twitter.Api(username=self.username, password=self.password) - def set_message(self, message): - self.message = message - def post(self, message): try: self.api.PostUpdate(message) diff --git a/install.py b/install.py index fb7fac1..6c61526 100644 --- a/install.py +++ b/install.py @@ -9,16 +9,16 @@ # and video data through icecast2 servers. # This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, +# abiding by the rules of distribution of free software. You can use, # modify and/ or redistribute the software under the terms of the CeCILL # license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". +# "http://www.cecill.info". # As a counterpart to the access to the source code and rights to copy, # modify and redistribute granted by the license, users are provided only # with a limited warranty and the software's author, the holder of the # economic rights, and the successive licensors have only limited -# liability. +# liability. # In this respect, the user's attention is drawn to the risks associated # with loading, using, modifying and/or developing or reproducing the @@ -27,8 +27,8 @@ # therefore means that it is reserved for developers and experienced # professionals having in-depth computer knowledge. Users are therefore # encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the +# requirements in conditions enabling the security of their systems and/or +# data to be ensured and, more generally, to use and operate it in the # same conditions as regards security. # The fact that you are presently reading this means that you have had @@ -57,10 +57,9 @@ if os.path.exists('/usr/bin/deefuzzer'): os.system('rm -r /usr/bin/deefuzzer') os.system('ln -s '+install_dir+os.sep+'deefuzzer.py '+'/usr/bin/deefuzzer') -os.system('ln -s '+install_dir+os.sep+'deefuzzer-deamon.sh '+'/usr/bin/deefuzzer-deamon') print """ - Installation successfull ! + Installation successfull ! Type 'deefuzzer' now... """ -- 2.39.5