예제 #1
0
def in_folder(r,f):
    if not r.startswith(f):
        return False
    #Get the path as a list
    r = util.split_escape(r,'/','\\')
    #Get the path of the folder
    f = util.split_escape(f,'/','\\')
    #make sure the resource path is one longer than module
    if not len(r)==len(f)+1:
        return False
    return True
def in_folder(r,f):
    """Return true if name r represents a kaihem resource in folder f"""
    #Note: this is about kaithem resources and folders, not actual filesystem dirs.
    if not r.startswith(f):
        return False
    #Get the path as a list
    r = util.split_escape(r,'/','\\')
    #Get the path of the folder
    f = util.split_escape(f,'/','\\')
    #make sure the resource path is one longer than module
    if not len(r)==len(f)+1:
        return False
    return True
def in_folder(r, f):
    """Return true if name r represents a kaihem resource in folder f"""
    # Note: this is about kaithem resources and folders, not actual filesystem dirs.
    if not r.startswith(f):
        return False
    # Get the path as a list
    r = util.split_escape(r, '/', '\\')
    # Get the path of the folder
    f = util.split_escape(f, '/', '\\')
    # make sure the resource path is one longer than module
    if not len(r) == len(f) + 1:
        return False
    return True
 def parsePath(self,s):
     return util.split_escape(s,"/","\\")
 def parsePath(self, s):
     return util.split_escape(s, "/", "\\")