[PAR2SET_JOIN] Fix detection code
authorIra W. Snyder <devel@irasnyder.com>
Mon, 1 Jan 2007 08:56:06 +0000 (00:56 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Mon, 1 Jan 2007 08:56:06 +0000 (00:56 -0800)
This makes the detection code more exact. This will now properly fail when
a set with the following files comes along:

Name matches:
X.par2
X.vol0+1.par2
X.001
X.002
...

Protection matches:
X.001
X.002
...

This new type will have to be handled in a seperate PAR2Set-derived class.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
PAR2Set_JOIN.py

index 59b2c9b..3381e72 100644 (file)
@@ -20,7 +20,8 @@ from RarslaveCommon import *
 #
 
 def detect_JOIN (name_files, prot_files):
-       return has_a_match ('^.*\.\d\d\d$', name_files)
+       return has_a_match ('^.*\.\d\d\d$', name_files) \
+                       and not has_a_match ('^.*\.\d\d\d$', prot_files)
 
 
 class PAR2Set_JOIN (PAR2Set.PAR2Set):