Changeset 194 for trunk/StreamVision


Ignore:
Timestamp:
09/19/05 08:52:08 (19 years ago)
Author:
Nicholas Riley
Message:

StreamVision.py: old changes for better name cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/StreamVision/StreamVision.py

    r193 r194  
    4141    return session.region.firsttag('a', class_='sky')['href']
    4242
    43 def cleanStreamName(name):
     43def cleanStreamTitle(title):
     44    if title == k.MissingValue:
     45        return ''
     46    title = title.split(' [')[0] # XXX move to description
     47    title = title.replace('`', u'’')
     48    return title
     49   
     50def cleanStreamTrackName(name):
    4451    name = name.split('. ')[0]
    4552    name = name.split(': ')[0]
     
    5057        name = name[0]
    5158    return name
    52    
    53 def cleanStreamTitle(title):
    54     if title == k.MissingValue:
    55         return ''
    56     title = title.replace('`', u'’')
    57     return title
    5859   
    5960def iTunesApp():
     
    7071            if iTunes.current_track.class_.get() == k.URL_track:
    7172                growlNotify(cleanStreamTitle(iTunes.current_stream_title.get()),
    72                             cleanStreamName(iTunes.current_track.name.get()))
     73                            cleanStreamTrackName(iTunes.current_track.name.get()))
    7374            else:
    7475                kw = {}
Note: See TracChangeset for help on using the changeset viewer.