コード例 #1
0
ファイル: specification.py プロジェクト: siq-legacy/lattice
    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