예제 #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)
예제 #2
0
파일: util.py 프로젝트: siq-legacy/lattice
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
예제 #3
0
파일: util.py 프로젝트: siq-legacy/lattice
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
예제 #4
0
파일: buildfile.py 프로젝트: siq/lattice
    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