'bam deps' command - working on basic level
This commit is contained in:
@@ -330,17 +330,25 @@ class bam_utils:
|
|||||||
if file_type != "dir":
|
if file_type != "dir":
|
||||||
print(" %s" % name_short)
|
print(" %s" % name_short)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def deps(paths, recursive=False):
|
||||||
|
import blendfile_path_walker
|
||||||
|
import os
|
||||||
|
# TODO(cam) multiple paths
|
||||||
|
for blendfile_src in paths:
|
||||||
|
blendfile_src = blendfile_src.encode('utf-8')
|
||||||
|
for fp, (rootdir, fp_blend_basename) in blendfile_path_walker.FilePath.visit_from_blend(
|
||||||
|
blendfile_src,
|
||||||
|
readonly=True,
|
||||||
|
recursive=recursive,
|
||||||
|
):
|
||||||
|
print(" %r -> %r" % (os.path.join(fp.basedir, fp_blend_basename), fp.filepath))
|
||||||
|
|
||||||
|
|
||||||
def subcommand_init_cb(args):
|
def subcommand_init_cb(args):
|
||||||
bam_utils.init(args.url, args.directory_name)
|
bam_utils.init(args.url, args.directory_name)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def deps(paths):
|
|
||||||
# TODO(cam) multiple paths
|
|
||||||
path = paths[0]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def subcommand_checkout_cb(args):
|
def subcommand_checkout_cb(args):
|
||||||
bam_utils.checkout(args.paths)
|
bam_utils.checkout(args.paths)
|
||||||
|
|
||||||
|
@@ -177,6 +177,9 @@ class FilePath:
|
|||||||
if rootdir is None:
|
if rootdir is None:
|
||||||
rootdir = basedir
|
rootdir = basedir
|
||||||
|
|
||||||
|
if lib_visit is None:
|
||||||
|
lib_visit = {}
|
||||||
|
|
||||||
if recursive and (level > 0) and (block_codes is not None):
|
if recursive and (level > 0) and (block_codes is not None):
|
||||||
# prevent from expanding the
|
# prevent from expanding the
|
||||||
# same datablock more then once
|
# same datablock more then once
|
||||||
@@ -340,6 +343,12 @@ class FilePath:
|
|||||||
|
|
||||||
# print("looking for", lib_block_codes)
|
# print("looking for", lib_block_codes)
|
||||||
|
|
||||||
|
if not os.path.exists(lib_path_abs):
|
||||||
|
if VERBOSE:
|
||||||
|
print((indent_str + " "), "Library Missing: ", filepath, " -> ", lib_path_abs, sep="")
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
# import IPython; IPython.embed()
|
# import IPython; IPython.embed()
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print((indent_str + " "), "Library: ", filepath, " -> ", lib_path_abs, sep="")
|
print((indent_str + " "), "Library: ", filepath, " -> ", lib_path_abs, sep="")
|
||||||
|
Reference in New Issue
Block a user