mirror of https://github.com/tLDP/python-tldp
user can now specify file, stem or nothing for build
This commit is contained in:
parent
39c4a13d88
commit
de514fd41b
|
@ -65,16 +65,24 @@ def status(config, args):
|
||||||
|
|
||||||
def build(config, args):
|
def build(config, args):
|
||||||
targets = list()
|
targets = list()
|
||||||
if not args:
|
stems = list()
|
||||||
i = tldp.inventory.Inventory(config.pubdir, config.sourcedir)
|
if args:
|
||||||
targets.extend(i.new.values())
|
|
||||||
targets.extend(i.stale.values())
|
|
||||||
targets.extend(i.broken.values())
|
|
||||||
else:
|
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if os.path.isfile(arg) or os.path.isdir(arg):
|
if os.path.isfile(arg) or os.path.isdir(arg):
|
||||||
source = tldp.sources.SourceDocument(arg)
|
source = tldp.sources.SourceDocument(arg)
|
||||||
targets.append(source)
|
targets.append(source)
|
||||||
|
else:
|
||||||
|
stems.append(arg)
|
||||||
|
if stems or not args:
|
||||||
|
i = tldp.inventory.Inventory(config.pubdir, config.sourcedir)
|
||||||
|
if stems:
|
||||||
|
for source in i.source.values():
|
||||||
|
if source.stem in stems:
|
||||||
|
targets.append(source)
|
||||||
|
else:
|
||||||
|
targets.extend(i.new.values())
|
||||||
|
targets.extend(i.stale.values())
|
||||||
|
targets.extend(i.broken.values())
|
||||||
for source in targets:
|
for source in targets:
|
||||||
if source.stem in config.skip:
|
if source.stem in config.skip:
|
||||||
logger.info("%s skipping build per request", source.stem)
|
logger.info("%s skipping build per request", source.stem)
|
||||||
|
|
Loading…
Reference in New Issue