Changeset 1885

Show
Ignore:
Timestamp:
16/11/08 18:51:46 (8 weeks ago)
Author:
duncan
svm:headrev:

cc3e1ea1-1e01-0410-8d68-8b121e83a9d5:11167
Message:

Processed by reindent

Location:
freevo/src
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • freevo/src/audio/plugins/detachbar.py

    r1883 r1885  
    8383 
    8484    | digraph finite_state_machine { 
    85     |   rankdir=TB; 
    86     |   size="8,5" 
    87     |   node [shape = doublecircle]; Hide; 
    88     |   node [shape = circle]; 
    89     |   { rank = same; "Wait"; "Show"; } 
    90     |   Hide -> Show [ label = "detach(start timer)" ]; 
    91     |   Show -> Wait [ label = "play_end" ]; 
    92     |   Show -> Hide [ label = "stop(stop timer)" ]; 
    93     |   Wait -> Hide [ label = "stop(stop timer)" ]; 
    94     |   Show -> Show [ label = "play_start" ]; 
    95     |   Wait -> Show [ label = "play_start" ]; 
    96     |   Wait -> Hide [ label = "timeout(stop timer)" ]; 
     85    |   rankdir=TB; 
     86    |   size="8,5" 
     87    |   node [shape = doublecircle]; Hide; 
     88    |   node [shape = circle]; 
     89    |   { rank = same; "Wait"; "Show"; } 
     90    |   Hide -> Show [ label = "detach(start timer)" ]; 
     91    |   Show -> Wait [ label = "play_end" ]; 
     92    |   Show -> Hide [ label = "stop(stop timer)" ]; 
     93    |   Wait -> Hide [ label = "stop(stop timer)" ]; 
     94    |   Show -> Show [ label = "play_start" ]; 
     95    |   Wait -> Show [ label = "play_start" ]; 
     96    |   Wait -> Hide [ label = "timeout(stop timer)" ]; 
    9797    | } 
    9898    """ 
  • freevo/src/directory.py

    r1773 r1885  
    8484        _('Show the items in the list in reverse order.'), False), 
    8585 
    86     ('DIRECTORY_AUDIO_FORMAT_STRING', '', '', False),  
     86    ('DIRECTORY_AUDIO_FORMAT_STRING', '', '', False), 
    8787 
    8888    ('DIRECTORY_CREATE_PLAYLIST', _('Directory Create Playlist'), 
  • freevo/src/image/viewer.py

    r1719 r1885  
    481481                if strtag[1] == 'date' and self.fileitem['timestamp']: 
    482482                    osdstring.append('%s %s' % (strtag[0], datetime.datetime.fromtimestamp(self.fileitem['timestamp']))) 
    483                      
     483 
    484484        # If after all that there is nothing then tell the users that 
    485485        if osdstring == []: 
  • freevo/src/plugins/idlebar/weather.py

    r1772 r1885  
    195195        else: 
    196196            image_x = ((text_w - image_w) / 2) 
    197             text_x = 0  
     197            text_x = 0 
    198198        image_y = osd.y + 7 
    199199        text_y = osd.y + 55 - text_h 
  • freevo/src/plugins/lcd.py

    r1794 r1885  
    643643        # Check if audio is detached 
    644644        # When in detached mode, do not draw the player screen 
    645         if type == 'player':  
     645        if type == 'player': 
    646646            if plugin.getbyname('audio.detachbar'): 
    647647                if plugin.getbyname('audio.detachbar').state != 1: #BAR_HIDE 
  • freevo/src/plugins/processevent.py

    r1800 r1885  
    6363        print '%s event_handler(%s) %s' % (time.strftime('%H:%M:%S'), event, event.__dict__) 
    6464        return True 
    65  
  • freevo/src/plugins/rom_drives.py

    r1768 r1885  
    6868        CDROM_SELECT_SPEED   = 0x5322  # Set the CD-ROM speed 
    6969        CDROM_SELECT_DISC    = 0x5323  # Select disc (for juke-boxes) 
    70         CDROM_MEDIA_CHANGED  = 0x5325  # Check is media changed  
     70        CDROM_MEDIA_CHANGED  = 0x5325  # Check is media changed 
    7171        CDROM_DRIVE_STATUS   = 0x5326  # Get tray position, etc. 
    7272        CDROM_DISC_STATUS    = 0x5327  # Get disc type, etc. 
     
    8383        # capability flags 
    8484        CDC_CLOSE_TRAY       = 0x1     # caddy systems _can't_ close 
    85         CDC_OPEN_TRAY        = 0x2     # but _can_ eject.  
     85        CDC_OPEN_TRAY        = 0x2     # but _can_ eject. 
    8686        CDC_LOCK             = 0x4     # disable manual eject 
    8787        CDC_SELECT_SPEED     = 0x8     # programmable speed 
  • freevo/src/plugins/speak.py

    r1709 r1885  
    5656 
    5757    | plugin.activate('speak') 
    58      
     58 
    5959    Additionally you can customize the messages spoken upon startup and shutdown of Freevo by setting 
    6060 
  • freevo/src/plugins/udpremote.py

    r1795 r1885  
    130130        if self.disable: return 
    131131 
    132         if type == 'player':  
     132        if type == 'player': 
    133133            if plugin.getbyname('audio.detachbar'): 
    134134                if plugin.getbyname('audio.detachbar').state != 1: #BAR_HIDE 
  • freevo/src/plugins/vfd.py

    r1795 r1885  
    592592        # Check if audio is detached 
    593593        # When in detached mode, do not draw the player screen 
    594         if type == 'player':  
     594        if type == 'player': 
    595595            if plugin.getbyname('audio.detachbar'): 
    596596                if plugin.getbyname('audio.detachbar').state != 1: #BAR_HIDE 
  • freevo/src/tv/plugins/genre.py

    r1718 r1885  
    106106    def actions(self): 
    107107        return [ (self.browse, _('Browse list'))] 
    108          
    109     
     108 
     109 
    110110    def browse(self, arg=None, menuw=None): 
    111         """  
     111        """ 
    112112        Find all genres/categories 
    113113        """ 
     
    132132                            categories.append(genre) 
    133133                            items.append(GenreItem(self.parent, genre)) 
    134           
     134 
    135135        # create menu 
    136136        menu = Menu(self.name, items, item_types='tv listing') 
    137137        menuw.pushmenu(menu) 
    138138        menuw.refresh() 
    139      
     139 
    140140 
    141141 
  • freevo/src/tv/plugins/recordings_manager.py

    r1809 r1885  
    901901                    filename == rpitem.files.edl_file or \ 
    902902                    filename == rpitem.files.image: 
    903                     # just in case only some of the item files have been deleted, add the  
    904                     # existing ones back into the added files so a new item is created for  
     903                    # just in case only some of the item files have been deleted, add the 
     904                    # existing ones back into the added files so a new item is created for 
    905905                    # those files. 
    906906                    for itemfile in rpitem.files.files + [rpitem.files.fxd_file, rpitem.files.edl_file, rpitem.files.image]: 
     
    918918 
    919919        rpitem_time = time.time() 
    920          
     920 
    921921        # Add the new recordings 
    922922        for recorded_item in added_recordings: 
  • freevo/src/util/feedparser.py

    r1776 r1885  
    142142# reversable htmlentitydefs mappings for Python 2.2 
    143143try: 
    144   from htmlentitydefs import name2codepoint, codepoint2name 
     144    from htmlentitydefs import name2codepoint, codepoint2name 
    145145except: 
    146   import htmlentitydefs 
    147   name2codepoint={} 
    148   codepoint2name={} 
    149   for (name,codepoint) in htmlentitydefs.entitydefs.iteritems(): 
    150     if codepoint.startswith('&#'): codepoint=unichr(int(codepoint[2:-1])) 
    151     name2codepoint[name]=ord(codepoint) 
    152     codepoint2name[ord(codepoint)]=name 
     146    import htmlentitydefs 
     147    name2codepoint={} 
     148    codepoint2name={} 
     149    for (name,codepoint) in htmlentitydefs.entitydefs.iteritems(): 
     150        if codepoint.startswith('&#'): codepoint=unichr(int(codepoint[2:-1])) 
     151        name2codepoint[name]=ord(codepoint) 
     152        codepoint2name[ord(codepoint)]=name 
    153153 
    154154# BeautifulSoup parser used for parsing microformats from embedded HTML content 
     
    268268            self[key] = value 
    269269        return self[key] 
    270          
     270 
    271271    def has_key(self, key): 
    272272        try: 
     
    274274        except AttributeError: 
    275275            return False 
    276          
     276 
    277277    def __getattr__(self, key): 
    278278        try: 
     
    330330            ''.join(map(chr, range(256))), ''.join(map(chr, emap))) 
    331331    return s.translate(_ebcdic_to_ascii_map) 
    332   
     332 
    333333_cp1252 = { 
    334334  unichr(128): unichr(8364), # euro sign 
     
    383383                  'http://www.w3.org/2005/Atom': '', 
    384384                  'http://purl.org/rss/1.0/modules/rss091#': '', 
    385                    
     385 
    386386                  'http://webns.net/mvcb/':                               'admin', 
    387387                  'http://purl.org/rss/1.0/modules/aggregation/':         'ag', 
     
    438438    can_contain_dangerous_markup = ['content', 'title', 'summary', 'info', 'tagline', 'subtitle', 'copyright', 'rights', 'description'] 
    439439    html_types = ['text/html', 'application/xhtml+xml'] 
    440      
     440 
    441441    def __init__(self, baseuri=None, baselang=None, encoding='utf-8'): 
    442442        if _debug: sys.stderr.write('initializing FeedParser\n') 
     
    480480        attrs = [(k.lower(), v) for k, v in attrs] 
    481481        attrs = [(k, k in ('rel', 'type') and v.lower() or v) for k, v in attrs] 
    482          
     482 
    483483        # track xml:base and xml:lang 
    484484        attrsD = dict(attrs) 
     
    503503        self.basestack.append(self.baseuri) 
    504504        self.langstack.append(lang) 
    505          
     505 
    506506        # track namespaces 
    507507        for prefix, uri in attrs: 
     
    541541        if (not prefix) and tag not in ('title', 'link', 'description', 'url', 'href', 'width', 'height'): 
    542542            self.inimage = 0 
    543          
     543 
    544544        # call special handler (if defined) or default handler 
    545545        methodname = '_start_' + prefix + suffix 
     
    660660            contentType = 'application/xhtml+xml' 
    661661        return contentType 
    662      
     662 
    663663    def trackNamespace(self, prefix, uri): 
    664664        loweruri = uri.lower() 
     
    681681    def resolveURI(self, uri): 
    682682        return _urljoin(self.baseuri or '', uri) 
    683      
     683 
    684684    def decodeEntities(self, element, data): 
    685685        return data 
     
    694694        if not self.elementstack: return 
    695695        if self.elementstack[-1][0] != element: return 
    696          
     696 
    697697        element, expectingText, pieces = self.elementstack.pop() 
    698698 
     
    730730            except binascii.Incomplete: 
    731731                pass 
    732                  
     732 
    733733        # resolve relative URIs 
    734734        if (element in self.can_be_relative_uri) and output: 
    735735            output = self.resolveURI(output) 
    736          
     736 
    737737        # decode entities within embedded markup 
    738738        if not self.contentparams.get('base64', 0): 
     
    757757            if element in self.can_contain_relative_uris: 
    758758                output = _resolveRelativeURIs(output, self.baseuri, self.encoding, self.contentparams.get('type', 'text/html')) 
    759                  
     759 
    760760        # parse microformats 
    761761        # (must do this before sanitizing because some microformats 
     
    773773                if vcard: 
    774774                    self._getContext()['vcard'] = vcard 
    775          
     775 
    776776        # sanitize embedded markup 
    777777        if is_htmlish and SANITIZE_HTML: 
     
    803803        if element == 'title' and self.hasTitle: 
    804804            return output 
    805          
     805 
    806806        # store output in appropriate place(s) 
    807807        if self.inentry and not self.insource: 
     
    851851        self.contentparams.clear() 
    852852        return value 
    853          
     853 
    854854    # a number of elements in a number of RSS variants are nominally plain 
    855855    # text, but this is routinely ignored.  This is an attempt to detect 
     
    882882            name = prefix + ':' + suffix 
    883883        return name 
    884          
     884 
    885885    def _getAttribute(self, attrsD, name): 
    886886        return attrsD.get(self._mapToStandardPrefix(name)) 
     
    910910            attrsD['href'] = href 
    911911        return attrsD 
    912      
     912 
    913913    def _save(self, key, value): 
    914914        context = self._getContext() 
     
    929929            else: 
    930930                self.version = 'rss' 
    931      
     931 
    932932    def _start_dlhottitles(self, attrsD): 
    933933        self.version = 'hotrss' 
     
    947947            self.elementstack[-1][-1] = attrsD['href'] 
    948948            self._end_link() 
    949      
     949 
    950950    def _start_feed(self, attrsD): 
    951951        self.infeed = 1 
     
    964964        self.infeed = 0 
    965965    _end_feed = _end_channel 
    966      
     966 
    967967    def _start_image(self, attrsD): 
    968968        context = self._getContext() 
     
    971971        self.hasTitle = 0 
    972972        self.push('image', 0) 
    973              
     973 
    974974    def _end_image(self): 
    975975        self.pop('image') 
     
    983983        self.push('textinput', 0) 
    984984    _start_textInput = _start_textinput 
    985      
     985 
    986986    def _end_textinput(self): 
    987987        self.pop('textinput') 
     
    11771177    _end_tagline = _end_subtitle 
    11781178    _end_itunes_subtitle = _end_subtitle 
    1179              
     1179 
    11801180    def _start_rights(self, attrsD): 
    11811181        self.pushContent('rights', attrsD, 'text/plain', 1) 
     
    12731273        if value: attrsD['href']=value 
    12741274        context.setdefault('links', []).append(attrsD) 
    1275          
     1275 
    12761276    def _start_creativecommons_license(self, attrsD): 
    12771277        self.push('license', 1) 
     
    12941294        if value not in xfn: 
    12951295            xfn.append(value) 
    1296          
     1296 
    12971297    def _addTag(self, term, scheme, label): 
    12981298        context = self._getContext() 
     
    13121312    _start_dc_subject = _start_category 
    13131313    _start_keywords = _start_category 
    1314          
     1314 
    13151315    def _end_itunes_keywords(self): 
    13161316        for term in self.pop('itunes_keywords').split(): 
    13171317            self._addTag(term, 'http://www.itunes.com/', None) 
    1318          
     1318 
    13191319    def _start_itunes_category(self, attrsD): 
    13201320        self._addTag(attrsD.get('text'), 'http://www.itunes.com/', None) 
    13211321        self.push('category', 1) 
    1322          
     1322 
    13231323    def _end_category(self): 
    13241324        value = self.pop('category') 
     
    13361336    def _start_cloud(self, attrsD): 
    13371337        self._getContext()['cloud'] = FeedParserDict(attrsD) 
    1338          
     1338 
    13391339    def _start_link(self, attrsD): 
    13401340        attrsD.setdefault('rel', 'alternate') 
     
    14381438        if context.has_key('generator_detail'): 
    14391439            context['generator_detail']['name'] = value 
    1440              
     1440 
    14411441    def _start_admin_generatoragent(self, attrsD): 
    14421442        self.push('generator', 1) 
     
    14531453            self.elementstack[-1][2].append(value) 
    14541454        self.pop('errorreportsto') 
    1455          
     1455 
    14561456    def _start_summary(self, attrsD): 
    14571457        context = self._getContext() 
     
    14711471        self._summaryKey = None 
    14721472    _end_itunes_summary = _end_summary 
    1473          
     1473 
    14741474    def _start_enclosure(self, attrsD): 
    14751475        attrsD = self._itsAnHrefDamnIt(attrsD) 
     
    14801480        if href and not context.get('id'): 
    14811481            context['id'] = href 
    1482              
     1482 
    14831483    def _start_source(self, attrsD): 
    14841484        self.insource = 1 
     
    15241524        self._getContext()['image'] = FeedParserDict({'href': attrsD.get('href')}) 
    15251525    _start_itunes_link = _start_itunes_image 
    1526          
     1526 
    15271527    def _end_itunes_block(self): 
    15281528        value = self.pop('itunes_block', 0) 
     
    15411541            self.bozo = 0 
    15421542            self.exc = None 
    1543          
     1543 
    15441544        def startPrefixMapping(self, prefix, uri): 
    15451545            self.trackNamespace(prefix, uri) 
    1546          
     1546 
    15471547        def startElementNS(self, name, qname, attrs): 
    15481548            namespace, localname = name 
     
    15581558            prefix = self._matchnamespaces.get(lowernamespace, givenprefix) 
    15591559            if givenprefix and (prefix == None or (prefix == '' and lowernamespace == '')) and not self.namespacesInUse.has_key(givenprefix): 
    1560                     raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix 
     1560                raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix 
    15611561            localname = str(localname).lower() 
    15621562 
     
    15781578            elif namespace and not qname: #Expat 
    15791579                for name,value in self.namespacesInUse.items(): 
    1580                      if name and value == namespace: 
    1581                          localname = name + ':' + localname 
    1582                          break 
     1580                    if name and value == namespace: 
     1581                        localname = name + ':' + localname 
     1582                        break 
    15831583            if _debug: sys.stderr.write('startElementNS: qname = %s, namespace = %s, givenprefix = %s, prefix = %s, attrs = %s, localname = %s\n' % (qname, namespace, givenprefix, prefix, attrs.items(), localname)) 
    15841584 
     
    16081608            elif namespace and not qname: #Expat 
    16091609                for name,value in self.namespacesInUse.items(): 
    1610                      if name and value == namespace: 
    1611                          localname = name + ':' + localname 
    1612                          break 
     1610                    if name and value == namespace: 
     1611                        localname = name + ':' + localname 
     1612                        break 
    16131613            localname = str(localname).lower() 
    16141614            self.unknown_endtag(localname) 
     
    16171617            self.bozo = 1 
    16181618            self.exc = exc 
    1619              
     1619 
    16201620        def fatalError(self, exc): 
    16211621            self.error(exc) 
     
    16271627    elements_no_end_tag = ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 
    16281628      'img', 'input', 'isindex', 'link', 'meta', 'param'] 
    1629      
     1629 
    16301630    def __init__(self, encoding, type): 
    16311631        self.encoding = encoding 
     
    16331633        if _debug: sys.stderr.write('entering BaseHTMLProcessor, encoding=%s\n' % self.encoding) 
    16341634        sgmllib.SGMLParser.__init__(self) 
    1635          
     1635 
    16361636    def reset(self): 
    16371637        self.pieces = [] 
     
    16551655        data = re.compile(r'<!((?!DOCTYPE|--|\[))', re.IGNORECASE).sub(r'&lt;!\1', data) 
    16561656        #data = re.sub(r'<(\S+?)\s*?/>', self._shorttag_replace, data) # bug [ 1399464 ] Bad regexp for _shorttag_replace 
    1657         data = re.sub(r'<([^<\s]+?)\s*/>', self._shorttag_replace, data)  
     1657        data = re.sub(r'<([^<\s]+?)\s*/>', self._shorttag_replace, data) 
    16581658        data = data.replace('&#39;', "'") 
    16591659        data = data.replace('&#34;', '"') 
     
    17181718        else: 
    17191719            self.pieces.append('&#%(ref)s;' % locals()) 
    1720          
     1720 
    17211721    def handle_entityref(self,