]> git.parisson.com Git - deefuzzer.git/commitdiff
clean up, twitting log
authorGuillaume Pellerin <yomguy@parisson.com>
Sat, 31 Oct 2009 13:00:50 +0000 (13:00 +0000)
committerGuillaume Pellerin <yomguy@parisson.com>
Sat, 31 Oct 2009 13:00:50 +0000 (13:00 +0000)
deefuzzer.py
install.py

index 8928ec341cf271f22dcf774e0b0c645d78efbceb..c81ebb974975475d768c9f3fee9891278f9e380d 100755 (executable)
@@ -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)
index fb7fac1fb2fd7a7109afeacdbda7f1c3f1a079a3..6c615267dc44d74e998a1f0a8dfc16f709fb50d8 100644 (file)
@@ -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...
    """