Пример #1
0
Файл: pool.py Проект: qrntz/pool
    def __init__(self, path=None, create=False):

        def pool_realpath(p):
            return join(realpath(p), ".pool")

        def get_default_path(create):
            path_cwd = os.getcwd()
            path_env = os.environ.get("POOL_DIR") or path_cwd

            if create:
                if isdir(pool_realpath(path_env)):
                    return path_cwd
                else:
                    return path_env

            else:
                if isdir(pool_realpath(path_cwd)):
                    return path_cwd
                else:
                    return path_env

        if path is None:
            path = get_default_path(create)

        path = pool_realpath(path)
        Paths.__init__(self, path)
Пример #2
0
    def __init__(self, path=None, create=False):
        def pool_realpath(p):
            return join(realpath(p), ".pool")

        def get_default_path(create):
            path_cwd = os.getcwd()
            path_env = os.environ.get("POOL_DIR") or path_cwd

            if create:
                if isdir(pool_realpath(path_env)):
                    return path_cwd
                else:
                    return path_env

            else:
                if isdir(pool_realpath(path_cwd)):
                    return path_cwd
                else:
                    return path_env

        if path is None:
            path = get_default_path(create)

        path = pool_realpath(path)
        Paths.__init__(self, path)
Пример #3
0
Файл: deck.py Проект: OnGle/deck
 def __init__(self, path=None):
     path = join(dirname(realpath(path)), ".deck")
     Paths.__init__(self, path)
Пример #4
0
 def __init__(self, path=None):
     path = join(dirname(realpath(path)), ".deck")
     Paths.__init__(self, path)
Пример #5
0
    def __init__(self, backup_root=None):
        if backup_root is None:
            backup_root = '/'

        Paths.__init__(self, join(backup_root, self.PATH))
Пример #6
0
    def __init__(self, path=None):
        if path is None:
            path = self.PATH

        Paths.__init__(self, path)
Пример #7
0
    def __init__(self, backup_root=None):
        if backup_root is None:
            backup_root = '/'

        Paths.__init__(self, join(backup_root, self.PATH))