Exemplo n.º 1
0
    def read(self, filepath='.'):
        filepath = path(filepath).abspath()
        if filepath.isdir():
            filepath /= self.filename

        content = Format.read(str(filepath))
        return self.parse(content, None)
Exemplo n.º 2
0
def uniqpath(root, prefix=''):
    if not isinstance(root, path):
        root = path(root)
    
    while True:
        candidate = root / ('%s%s' % (prefix, str(uuid4()).replace('-', '')[:8]))
        if not candidate.exists():
            return candidate
Exemplo n.º 3
0
def uniqpath(root, prefix=''):
    if not isinstance(root, path):
        root = path(root)

    while True:
        candidate = root / ('%s%s' %
                            (prefix, str(uuid4()).replace('-', '')[:8]))
        if not candidate.exists():
            return candidate
Exemplo n.º 4
0
    def __init__(self, buildfile):
        if not isinstance(buildfile, path):
            buildfile = path(buildfile)

        self.buildfile = buildfile
        self.components = {}

        if self.buildfile.exists():
            for line in self.buildfile.bytes().strip().split('\n'):
                line = line.strip()
                if line:
                    component, version = line.split(' ', 1)
                    self.components[component] = version