kdeSvnPath() may return False but then
kdeSvnUnpack() will fail because False has no method rindex()

again I am not sure how to fix this. I think
kdeSvnPath() should return None for no path found
(would be more pythonic)
and kdeSvnUnpack() should return False if kdeSvnPath() is None

that is compatible with all callers of svnPath() since None and
False both evaluate to False in if-statements

current wrong code:

def kdeSvnPath( self ):
    """overload this function in kde packages to use the nocopy option"""
    """this function should return the full path seen from /home/KDE/"""
    if self.subinfo.buildTarget in self.subinfo.svnTargets.keys():
        return self.subinfo.svnTargets[ self.subinfo.buildTarget ]
    else:
        return False

def kdeSvnUnpack( self, svnpath=None, packagedir=None ):
    """fetching and copying the sources from svn"""
    if not svnpath and not packagedir:
        if self.kdeSvnPath():
            svnpath = self.kdeSvnPath()[ :self.kdeSvnPath().rfind('/') ]
            packagedir = self.kdeSvnPath()[ self.kdeSvnPath().rfind('/') + 1:]


-- 
Wolfgang
_______________________________________________
Kde-windows mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-windows

Reply via email to