public
Description: Simple to use TVDB (thetvdb.com) API in Python, and automatic TV episode namer
Homepage: http://dbr.lighthouseapp.com/projects/13342-tvdb_api/tickets
Clone URL: git://github.com/dbr/tvdb_api.git
Commented break statement in processNames, whitespace after file-showname 
cleanup
dbr (author)
Thu Jul 24 06:20:50 -0700 2008
commit  2c312811601ed233d33931f7c3a0b03817d18bbd
tree    6dc79f842176835d1e4df38ef6b405afcb7359de
parent  4c9c9feefeb4ced375fcb71665d718262aaf55c1
...
76
77
78
 
79
80
 
81
82
83
84
 
85
86
 
 
87
88
89
...
102
103
104
105
 
106
107
108
...
76
77
78
79
80
81
82
83
84
85
86
87
88
 
89
90
91
92
93
...
106
107
108
 
109
110
111
112
0
@@ -76,14 +76,18 @@ def processNames(names, verbose=False):
0
     for f in names:
0
         filepath, filename = os.path.split( f )
0
         filename, ext = os.path.splitext( filename )
0
+
0
         # Remove leading . from extension
0
         ext = ext.replace(".", "", 1)
0
+
0
         for r in config['name_parse']:
0
             match = r.match(filename)
0
             if match:
0
                 showname, seasno, epno = match.groups()
0
+
0
                 #remove ._- characters from name (- removed only if next to end of line)
0
- showname = re.sub("[\._]|\-(?=$)", " ", showname).strip()
0
+ showname = re.sub("[\._]|\-(?=$)", " ", showname).strip()
0
+
0
                 seasno, epno = int(seasno), int(epno)
0
                 
0
                 if verbose:
0
@@ -102,7 +106,7 @@ def processNames(names, verbose=False):
0
                                 'filename':filename,
0
                                 'ext':ext
0
                              })
0
- break
0
+ break # Matched - to the next file!
0
         else:
0
             print "Invalid name: %s" % (f)
0
         #end for r

Comments

    No one has commented yet.