]> git.parisson.com Git - deefuzzer.git/commitdiff
Lots of style fixes
authorachbed <github@achbed.org>
Mon, 26 Jan 2015 23:41:42 +0000 (17:41 -0600)
committerachbed <github@achbed.org>
Mon, 26 Jan 2015 23:41:42 +0000 (17:41 -0600)
Also:
  Fixes for a few "using unset variable" cases
  Began removing calls to .has_key() (depreciated)
  Fixed reference issue on raiseErrors flag (should have been self.raiseErrors)

Signed-off-by: achbed <github@achbed.org>
20 files changed:
deefuzzer/core.py
deefuzzer/station.py
deefuzzer/streamer.py
deefuzzer/tools/PyRSS2Gen.py
deefuzzer/tools/mp3.py
deefuzzer/tools/ogg.py
deefuzzer/tools/xmltodict.py
deefuzzer/tools/xmltodict2.py
scripts/osc/osc_jingles_start.py
scripts/osc/osc_jingles_stop.py
scripts/osc/osc_player_fast.py
scripts/osc/osc_player_next.py
scripts/osc/osc_player_slow.py
scripts/osc/osc_record_start.py
scripts/osc/osc_record_stop.py
scripts/osc/osc_relay_start.py
scripts/osc/osc_relay_stop.py
scripts/osc/osc_twitter_start.py
scripts/osc/osc_twitter_stop.py
setup.py

index ee82fd5fbe6e17615ecbdc70c934b4c61e2ac837..954c29096718ec69278d7bfab772e9b7574ed53f 100644 (file)
@@ -68,7 +68,7 @@ class DeeFuzzer(Thread):
         self.conf_file = conf_file
         self.conf = get_conf_dict(self.conf_file)
 
-        if not 'deefuzzer' in self.conf.keys():
+        if 'deefuzzer' not in self.conf.keys():
             return
 
         # Get the log setting first (if possible)
@@ -266,12 +266,12 @@ class DeeFuzzer(Thread):
         while True:
             self.create_stations_fromfolder()
             ns_new = len(self.station_settings)
-            if(ns_new > ns):
+            if ns_new > ns:
                 self._info('Loading new stations')
             
             for i in range(0, ns_new):
+                name = ''
                 try:
-                    name = ''
                     if 'station_name' in self.station_settings[i].keys():
                         name = self.station_settings[i]['station_name']
                     
@@ -294,17 +294,21 @@ class DeeFuzzer(Thread):
                                 continue
 
                             self.station_settings[i]['retries'] += 1
-                            self._info('Restarting station ' + name + ' (try ' + str(self.station_settings[i]['retries']) + ')')
+                            trynum = str(self.station_settings[i]['retries'])
+                            self._info('Restarting station ' + name + ' (try ' + trynum + ')')
                     except Exception as e:
                         self._err('Error checking status for ' + name)
                         self._err(str(e))
-                        if not ignoreErrors:
+                        if not self.ignoreErrors:
                             raise
 
                     # Apply station defaults if they exist
                     if 'stationdefaults' in self.conf['deefuzzer']:
                         if isinstance(self.conf['deefuzzer']['stationdefaults'], dict):
-                            self.station_settings[i] = merge_defaults(self.station_settings[i], self.conf['deefuzzer']['stationdefaults'])
+                            self.station_settings[i] = merge_defaults(
+                                self.station_settings[i],
+                                self.conf['deefuzzer']['stationdefaults']
+                            )
 
                     if name == '':
                         name = 'Station ' + str(i)
@@ -329,7 +333,7 @@ class DeeFuzzer(Thread):
                         self._err('Error validating station ' + name)
                 except Exception:
                     self._err('Error initializing station ' + name)
-                    if not ignoreErrors:
+                    if not self.ignoreErrors:
                         raise
                     continue
 
index 59eeb15684eac15264c71d65e3842f8fb97d6c20..4e34f09ebd950a78926758ce89aca41e45a088fc 100644 (file)
@@ -375,16 +375,18 @@ class Station(Thread):
 
             if self.type == 'icecast':
                 date = datetime.datetime.now().strftime("%Y")
+                media = None
                 if self.channel.format == 'mp3':
                     media = Mp3(self.record_dir + os.sep + self.rec_file)
                 if self.channel.format == 'ogg':
                     media = Ogg(self.record_dir + os.sep + self.rec_file)
-                media.metadata = {'artist': self.artist.encode('utf-8'),
-                                  'title': self.title.encode('utf-8'),
-                                  'album': self.short_name.encode('utf-8'),
-                                  'genre': self.channel.genre.encode('utf-8'),
-                                  'date': date.encode('utf-8'), }
-                media.write_tags()
+                if media:
+                    media.metadata = {'artist': self.artist.encode('utf-8'),
+                                      'title': self.title.encode('utf-8'),
+                                      'album': self.short_name.encode('utf-8'),
+                                      'genre': self.channel.genre.encode('utf-8'),
+                                      'date': date.encode('utf-8'), }
+                    media.write_tags()
 
         self.record_mode = value
         message = "received OSC message '%s' with arguments '%d'" % (path, value)
@@ -452,23 +454,24 @@ class Station(Thread):
             for media_obj in new_tracks_objs:
                 title = ''
                 artist = ''
-                if media_obj.metadata.has_key('title'):
+                if 'title' in media_obj.metadata:
                     title = media_obj.metadata['title']
-                if media_obj.metadata.has_key('artist'):
+                if 'artist' in media_obj.metadata:
                     artist = media_obj.metadata['artist']
                 if not (title or artist):
                     song = str(media_obj.file_name)
                 else:
                     song = artist + ' - ' + title
-                    song = song.encode('utf-8')
-                    artist = artist.encode('utf-8')
 
-                    artist_names = artist.split(' ')
-                    artist_tags = ' #'.join(list(set(artist_names) - {'&', '-'}))
-                    message = '#NEWTRACK ! %s #%s on #%s RSS: ' % \
-                              (song.replace('_', ' '), artist_tags, self.short_name)
-                    message = message[:113] + self.feeds_url
-                    self.update_twitter(message)
+                song = song.encode('utf-8')
+                artist = artist.encode('utf-8')
+
+                artist_names = artist.split(' ')
+                artist_tags = ' #'.join(list(set(artist_names) - {'&', '-'}))
+                message = '#NEWTRACK ! %s #%s on #%s RSS: ' % \
+                          (song.replace('_', ' '), artist_tags, self.short_name)
+                message = message[:113] + self.feeds_url
+                self.update_twitter(message)
 
     def get_next_media(self):
         # Init playlist
@@ -728,7 +731,7 @@ class Station(Thread):
         if not self.__twitter_should_update():
             return
         artist_names = self.artist.split(' ')
-        artist_tags = ' #'.join(list(set(artist_names) - {'&', '-'}))
+        artist_tags = ' #'.join(list(set(artist_names) - {'&', '-'}))
         message = '%s %s on #%s' % (self.prefix, self.song, self.short_name)
         tags = '#' + ' #'.join(self.twitter_tags)
         message = message + ' ' + tags
index 49d990978c9db2a4a32e99ae971d2650af9257d7..54fb5ca0822bf266fa94aa99c99b8364adb36356 100644 (file)
@@ -53,7 +53,7 @@ class HTTPStreamer(Thread):
     decription = str
     format = str
     url = str
-    delay = 0
+    _delay = 0
 
     def __init__(self):
         Thread.__init__(self)
@@ -65,7 +65,7 @@ class HTTPStreamer(Thread):
         self.read_callback = read_callback
 
     def delay(self):
-        return self.delay
+        return self._delay
 
     def open(self):
         import pycurl
index eb4edc323155f8ff3fcaf2afbb0ba381f83c28a8..56b249a5097c3244ccf44b68ee006c2ef3ab6994 100644 (file)
@@ -32,7 +32,9 @@ class WriteXmlMixin:
         return f.getvalue()
 
 
-def _element(handler, name, obj, d={}):
+def _element(handler, name, obj, d=None):
+    if not d:
+        d = {}
     if isinstance(obj, basestring) or obj is None:
         # special-case handling to make the API easier
         # to use for the common case.
@@ -232,11 +234,11 @@ class Enclosure:
         self.type = type
 
     def publish(self, handler):
-        _element(handler, "enclosure", None,
-                 {"url": self.url,
-                  "length": str(self.length),
-                  "type": self.type,
-                 })
+        _element(handler, "enclosure", None, {
+            "url": self.url,
+            "length": str(self.length),
+            "type": self.type
+        })
 
 
 class Source:
@@ -296,31 +298,31 @@ class RSS2(WriteXmlMixin):
     rss_attrs = {"version": "2.0"}
     element_attrs = {}
 
-    def __init__(self,
-                 title,
-                 link,
-                 description,
-
-                 language=None,
-                 copyright=None,
-                 managingEditor=None,
-                 webMaster=None,
-                 pubDate=None,  # a datetime, *in* *GMT*
-                 lastBuildDate=None,  # a datetime
-
-                 categories=None,  # list of strings or Category
-                 generator=_generator_name,
-                 docs="http://blogs.law.harvard.edu/tech/rss",
-                 cloud=None,  # a Cloud
-                 ttl=None,  # integer number of minutes
-
-                 image=None,  # an Image
-                 rating=None,  # a string; I don't know how it's used
-                 textInput=None,  # a TextInput
-                 skipHours=None,  # a SkipHours with a list of integers
-                 skipDays=None,  # a SkipDays with a list of strings
-
-                 items=None,  # list of RSSItems
+    def __init__(
+        self,
+        title,
+        link,
+        description,
+
+        language=None,
+        copyright=None,
+        managingEditor=None,
+        webMaster=None,
+        pubDate=None,  # a datetime, *in* *GMT*
+        lastBuildDate=None,  # a datetime
+
+        categories=None,  # list of strings or Category
+        generator=_generator_name,
+        docs="http://blogs.law.harvard.edu/tech/rss",
+        cloud=None,  # a Cloud
+        ttl=None,  # integer number of minutes
+
+        image=None,  # an Image
+        rating=None,  # a string; I don't know how it's used
+        textInput=None,  # a TextInput
+        skipHours=None,  # a SkipHours with a list of integers
+        skipDays=None,  # a SkipDays with a list of strings
+        items=None  # list of RSSItems
     ):
         self.title = title
         self.link = link
@@ -417,17 +419,18 @@ class RSSItem(WriteXmlMixin):
     """Publish an RSS Item"""
     element_attrs = {}
 
-    def __init__(self,
-                 title=None,  # string
-                 link=None,  # url as string
-                 description=None,  # string
-                 author=None,  # email address as string
-                 categories=None,  # list of string or Category
-                 comments=None,  # url as string
-                 enclosure=None,  # an Enclosure
-                 guid=None,  # a unique string
-                 pubDate=None,  # a datetime
-                 source=None,  # a Source
+    def __init__(
+        self,
+        title=None,  # string
+        link=None,  # url as string
+        description=None,  # string
+        author=None,  # email address as string
+        categories=None,  # list of string or Category
+        comments=None,  # url as string
+        enclosure=None,  # an Enclosure
+        guid=None,  # a unique string
+        pubDate=None,  # a datetime
+        source=None  # a Source
     ):
 
         if title is None and description is None:
index fac15a167102b8cba69e1dc8491bdf23f1aa8633..eb3f61e29aa32d689745f9140290a6feeff4b1a8 100644 (file)
@@ -60,14 +60,15 @@ class Mp3:
         self.options = {}
         self.bitrate_default = '192'
         self.cache_dir = os.sep + 'tmp'
-        self.keys2id3 = {'title': 'TIT2',
-                         'artist': 'TPE1',
-                         'album': 'TALB',
-                         'date': 'TDRC',
-                         'comment': 'COMM',
-                         'country': 'COUNTRY',
-                         'genre': 'TCON',
-                         'copyright': 'TCOP',
+        self.keys2id3 = {
+            'title': 'TIT2',
+            'artist': 'TPE1',
+            'album': 'TALB',
+            'date': 'TDRC',
+            'comment': 'COMM',
+            'country': 'COUNTRY',
+            'genre': 'TCON',
+            'copyright': 'TCOP'
         }
         self.mp3 = MP3(self.media, ID3=EasyID3)
         self.info = self.mp3.info
@@ -76,14 +77,15 @@ class Mp3:
         try:
             self.metadata = self.get_file_metadata()
         except:
-            self.metadata = {'title': '',
-                             'artist': '',
-                             'album': '',
-                             'date': '',
-                             'comment': '',
-                             'country': '',
-                             'genre': '',
-                             'copyright': '',
+            self.metadata = {
+                'title': '',
+                'artist': '',
+                'album': '',
+                'date': '',
+                'comment': '',
+                'country': '',
+                'genre': '',
+                'copyright': ''
             }
 
         self.description = self.get_description()
@@ -128,6 +130,7 @@ class Mp3:
         self.mp3.tags['TIT2'] = id3.TIT2(encoding=2, text=u'text')
         self.mp3.save()
 
+        '''
         # media_id3 = id3.ID3(self.media)
         # for tag in self.metadata.keys():
             # if tag in self.dub2id3_dict.keys():
@@ -143,6 +146,7 @@ class Mp3:
             # media_id3.save()
         # except:
             # raise IOError('ExporterError: cannot write tags')
+        '''
 
         media = id3.ID3(self.media)
         media.add(id3.TIT2(encoding=3, text=self.metadata['title'].decode('utf8')))
index bca591d8f3ebe70cd003d418f98abab42c64f6c9..5fea49b694f81e5f04bd334df42df53979ab3d9d 100644 (file)
@@ -54,13 +54,14 @@ class Ogg:
         self.options = {}
         self.bitrate_default = '192'
         self.cache_dir = os.sep + 'tmp'
-        self.keys2ogg = {'title': 'title',
-                         'artist': 'artist',
-                         'album': 'album',
-                         'date': 'date',
-                         'comment': 'comment',
-                         'genre': 'genre',
-                         'copyright': 'copyright',
+        self.keys2ogg = {
+            'title': 'title',
+            'artist': 'artist',
+            'album': 'album',
+            'date': 'date',
+            'comment': 'comment',
+            'genre': 'genre',
+            'copyright': 'copyright'
         }
         self.info = self.ogg.info
         self.bitrate = int(str(self.info.bitrate)[:-3])
index 7d5e070260c7be8241005ae59b2e0cc6fc1d4453..d1853beac2e3ead4543a18a17dbc7fb101ebb1d3 100644 (file)
@@ -7,8 +7,7 @@ def haschilds(dom):
     # Checks whether an element has any childs
     # containing real tags opposed to just text.
     for childnode in dom.childNodes:
-        if childnode.nodeName != "#text" and \
-                        childnode.nodeName != "#cdata-section":
+        if childnode.nodeName != "#text" and childnode.nodeName != "#cdata-section":
             return True
     return False
 
index 1724ec370fa021b7f7b2102105fe0a41477f07d0..ad44f038d8d1e1ad83d18a0d50aac64f13ef13a8 100644 (file)
@@ -9,6 +9,9 @@ import string
 import locale
 from xml.parsers import expat
 
+""" """
+
+'''
 # If we're in Dabo, get the default encoding.
 # import dabo
 # import dabo.lib.DesignerUtils as desUtil
@@ -22,6 +25,7 @@ from xml.parsers import expat
         # if enc is None:
             # enc = dabo.defaultEncoding
         # default_encoding = enc
+'''
 
 # Python seems to need to compile code with \n linesep:
 code_linesep = "\n"
@@ -123,7 +127,6 @@ class Xml2Obj:
         else:
             self.nodeStack = self.nodeStack[:-1]
 
-
     def CharacterData(self, data):
         """SAX character data event handler"""
         if self._inCode or data.strip():
@@ -142,7 +145,6 @@ class Xml2Obj:
                     element["cdata"] = ""
                 element["cdata"] += data
 
-
     def Parse(self, xml):
         # Create a SAX parser
         Parser = expat.ParserCreate()
@@ -155,15 +157,18 @@ class Xml2Obj:
         return self.root
 
     def ParseFromFile(self, filename):
-        return self.Parse(open(filename,"r").read())
+        return self.Parse(open(filename, "r").read())
 
 
-def xmltodict(xml, attsToSkip=[], addCodeFile=False):
+def xmltodict(xml, attsToSkip=None, addCodeFile=False):
     """Given an xml string or file, return a Python dictionary."""
+    if not attsToSkip:
+        attsToSkip = []
     parser = Xml2Obj()
     parser.attsToSkip = attsToSkip
     isPath = os.path.exists(xml)
     errmsg = ""
+    ret = None
     if eol not in xml and isPath:
         # argument was a file
         try:
@@ -206,8 +211,8 @@ def escQuote(val, noEscape=False, noQuote=False):
         qt = ''
     else:
         qt = '"'
-    slsh = "\\"
-#   val = val.replace(slsh, slsh+slsh)
+    slsh = "\\"
+    # val = val.replace(slsh, slsh+slsh)
     if not noEscape:
         # First escape internal ampersands. We need to double them up due to a
         # quirk in wxPython and the way it displays this character.
@@ -258,8 +263,8 @@ def dicttoxml(dct, level=0, header=None, linesep=None):
 
         if dct.has_key("code"):
             if len(dct["code"].keys()):
-                ret += "%s%s<code>%s" % (eol, "\t" * (level+1), eol)
-                methodTab = "\t" * (level+2)
+                ret += "%s%s<code>%s" % (eol, "\t" * (level + 1), eol)
+                methodTab = "\t" * (level + 2)
                 for mthd, cd in dct["code"].items():
                     # Convert \n's in the code to eol:
                     cd = eol.join(cd.splitlines())
@@ -268,28 +273,29 @@ def dicttoxml(dct, level=0, header=None, linesep=None):
                     if not cd.endswith(eol):
                         cd += eol
 
-                    ret += "%s<%s><![CDATA[%s%s]]>%s%s</%s>%s" % (methodTab,
-                            mthd, eol, cd, eol,
-                            methodTab, mthd, eol)
-                ret += "%s</code>%s" % ("\t" * (level+1), eol)
+                    ret += "%s<%s><![CDATA[%s%s]]>%s%s</%s>%s" % (
+                        methodTab, mthd, eol,
+                        cd, eol,
+                        methodTab, mthd, eol
+                    )
+                ret += "%s</code>%s" % ("\t" * (level + 1), eol)
 
         if dct.has_key("properties"):
             if len(dct["properties"].keys()):
-                ret += "%s%s<properties>%s" % (eol, "\t" * (level+1), eol)
-                currTab = "\t" * (level+2)
+                ret += "%s%s<properties>%s" % (eol, "\t" * (level + 1), eol)
+                currTab = "\t" * (level + 2)
                 for prop, val in dct["properties"].items():
                     ret += "%s<%s>%s" % (currTab, prop, eol)
                     for propItm, itmVal in val.items():
-                        itmTab = "\t" * (level+3)
-                        ret += "%s<%s>%s</%s>%s" % (itmTab, propItm, itmVal,
-                                propItm, eol)
+                        itmTab = "\t" * (level + 3)
+                        ret += "%s<%s>%s</%s>%s" % (itmTab, propItm, itmVal, propItm, eol)
                     ret += "%s</%s>%s" % (currTab, prop, eol)
-                ret += "%s</properties>%s" % ("\t" * (level+1), eol)
+                ret += "%s</properties>%s" % ("\t" * (level + 1), eol)
 
         if dct.has_key("children") and len(dct["children"]) > 0:
             ret += eol
             for child in dct["children"]:
-                ret += dicttoxml(child, level+1, linesep=linesep)
+                ret += dicttoxml(child, level + 1, linesep=linesep)
         indnt = ""
         if ret.endswith(eol):
             # Indent the closing tag
@@ -301,8 +307,7 @@ def dicttoxml(dct, level=0, header=None, linesep=None):
 
     if level == 0:
         if header is None:
-            header = '<?xml version="1.0" encoding="%s" standalone="no"?>%s' \
-                    % (default_encoding, eol)
+            header = '<?xml version="1.0" encoding="%s" standalone="no"?>%s' % (default_encoding, eol)
         ret = header + ret
 
     return ret
@@ -339,8 +344,11 @@ def flattenClassDict(cd, retDict=None):
             classCode = classCD.get("code", {})
             classKids = classCD.get("children", [])
             currDict = retDict.get(classID, {})
-            retDict[classID] = {"attributes": classAtts, "code": classCode,
-                    "properties": classProps}
+            retDict[classID] = {
+                "attributes": classAtts,
+                "code": classCode,
+                "properties": classProps
+            }
             retDict[classID].update(currDict)
             # Now update the child objects in the dict
             for kid in classKids:
@@ -348,8 +356,11 @@ def flattenClassDict(cd, retDict=None):
         else:
             # Not a file; most likely just a component in another class
             currDict = retDict.get(classID, {})
-            retDict[classID] = {"attributes": atts, "code": code,
-                    "properties": props}
+            retDict[classID] = {
+                "attributes": atts,
+                "code": code,
+                "properties": props
+            }
             retDict[classID].update(currDict)
     if kids:
         for kid in kids:
@@ -381,8 +392,7 @@ def addInheritedInfo(src, super, updateCode=False):
         for kid in kids:
             addInheritedInfo(kid, super, updateCode)
 
-
-
+'''
 # if __name__ == "__main__":
     # test_dict = {"name": "test", "attributes":{"path": "c:\\temp\\name",
             # "problemChars": "Welcome to <Jos\xc3\xa9's \ Stuff!>\xc2\xae".decode("latin-1")}}
@@ -392,3 +402,4 @@ def addInheritedInfo(src, super, updateCode=False):
     # test_dict2 = xmltodict(xml)
     # print "test_dict2:", test_dict2
     # print "same?:", test_dict == test_dict2
+'''
index 3f2ebf07478f75d0da08eb35db03115b8452159f..6e5177c28e2fcdca74baffa1155a272c8deb6de7 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index d29f721be0dbea821307ecc5577295ea014ccc2e..84e30447c22c10f03b47ea2be4c4e73fdbe67580 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 92a60fe6e599aa5257435440b7652758c9aedeee..fedf9db3aa3a47911780100d5253df532d055d83 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 21a91ee825445434c9f07f55f4fab1b8e70695ab..ef0e30f37b297df0b3d70d403ce6fcb8852cd5ba 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 02948e0fe69df25d0c0f44c0bbaa5f9e62f3256c..a5761bd5faac026a541ab920ba1a46f179237edf 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 779e90b896054bd8028ef12625537c85440c407e..d0b5fe5f293020bea0fa66fa1a1604d7abc8f8c0 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 8056c6933d29cc1fa36cd493d979a4a32ad741a5..0bfa651d8e82b40d7227858aff64ae30c64d933a 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 14bcb69d17ab495eaacbe6837bac9a0bfd38cb5a..19c06a1b1a60d3b82fd2eb4960d0cabdfd093a40 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index eaefe1ade9262bed5f478be28b0e97bb6ad7c912..d54af348e439f17370de9f0e286f1b2b9ba252c1 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index c298be6f2fca41a03f1a98a85041121c2fc33cdf..b10d0ccd010726c516113e1277d83e7b1a23d892 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 3470fccfbc78a318cff403d44c5e7749dff1c33c..1a339476dd5edecca811f0ca43232e4126189afc 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import liblo, sys
+import liblo
+import sys
 
 # send all messages to port 1234 on the local machine
 try:
index 56cccad48989f1329ffcc9a648c4ce8d05791c5e..b0c6bf93abfad310f34430b5888e3c3f3a0a6583 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,37 +1,38 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-'''The setup and build script for the library.'''
+"""The setup and build script for the library."""
 
 from setuptools import setup, find_packages
 
-CLASSIFIERS = ['Programming Language :: Python',
-                'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
-                'Topic :: Multimedia :: Sound/Audio',
-                'Topic :: Multimedia :: Sound/Audio :: Players',]
+CLASSIFIERS = [
+    'Programming Language :: Python',
+    'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+    'Topic :: Multimedia :: Sound/Audio',
+    'Topic :: Multimedia :: Sound/Audio :: Players'
+]
 
 setup(
-  name = "DeeFuzzer",
-  url = "http://github.com/yomguy/DeeFuzzer",
-  description = "open, light and instant media streaming tool",
-  long_description = open('README.rst').read(),
-  author = "Guillaume Pellerin",
-  author_email = "yomguy@parisson.com",
-  version = '0.7',
-  install_requires = [
+    name="DeeFuzzer",
+    url="http://github.com/yomguy/DeeFuzzer",
+    description="open, light and instant media streaming tool",
+    long_description=open('README.rst').read(),
+    author="Guillaume Pellerin",
+    author_email="yomguy@parisson.com",
+    version='0.7',
+    install_requires=[
         'setuptools',
         'python-shout',
         'python-twitter',
         'mutagen',
         'pyliblo',
-        'pycurl',
-  ],
-  platforms=['OS Independent'],
-  license='CeCILL v2',
-  scripts=['scripts/deefuzzer'],
-  classifiers = CLASSIFIERS,
-  packages = find_packages(),
-  include_package_data = True,
-  zip_safe = False,
+        'pycurl'
+    ],
+    platforms=['OS Independent'],
+    license='CeCILL v2',
+    scripts=['scripts/deefuzzer'],
+    classifiers=CLASSIFIERS,
+    packages=find_packages(),
+    include_package_data=True,
+    zip_safe=False
 )
-