rename/reshuffle modules

This commit is contained in:
2014-11-05 14:48:10 +01:00
parent 4ebe917ee1
commit 8b1085edd1
6 changed files with 27 additions and 25 deletions

View File

@@ -300,6 +300,13 @@ class bam_utils:
print(" %s" % name_short)
@staticmethod
def deps(paths):
# TODO(cam) multiple paths
path = paths[0]
def subcommand_checkout_cb(args):
bam_utils.checkout(args.paths)

View File

@@ -69,7 +69,7 @@ def pack(blendfile_src, blendfile_dst, mode='FILE',
WRITE_JSON_REMAP = True
if report is None:
raise Exception("report not set!")
report = lambda msg: msg
yield report("%s: %r...\n" % (colorize("\nscanning deps", color='bright_green'), blendfile_src))
@@ -282,6 +282,9 @@ def create_argparse():
parser.add_argument(
"-s", "--paths_remap", dest="paths_remap", metavar='FILE',
help="Write out the original paths to a JSON file")
parser.add_argument(
"-u", "--paths_uuid", dest="paths_uuid", metavar='FILE',
help="Write out the original paths UUID to a JSON file")
return parser
@@ -296,13 +299,17 @@ def main():
deps_remap = {} if args.deps_remap else None
paths_remap = {} if args.paths_remap else None
paths_uuid = {} if args.paths_uuid else None
pack(args.path_src.encode(encoding),
for msg in pack(
args.path_src.encode(encoding),
args.path_dst.encode(encoding),
args.mode,
deps_remap,
paths_remap,
)
deps_remap=deps_remap,
paths_remap=paths_remap,
paths_uuid=paths_uuid,
):
print(msg)
def write_dict_as_json(fn, dct):
with open(fn, 'w', encoding='utf-8') as f:
@@ -320,6 +327,9 @@ def main():
if paths_remap is not None:
write_dict_as_json(args.paths_remap, paths_remap)
if paths_uuid is not None:
write_dict_as_json(args.paths_uuid, paths_uuid)
del write_dict_as_json
if __name__ == "__main__":

View File

@@ -21,7 +21,7 @@
# Ensure module path
import os
import sys
path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "modules"))
path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "modules"))
if path not in sys.path:
sys.path.append(path)
del os, sys, path
@@ -255,28 +255,13 @@ class FileAPI(Resource):
import os
assert(os.path.exists(filepath) and not os.path.isdir(filepath))
modpath = \
os.path.normpath(
os.path.abspath(
os.path.join(
os.path.dirname(__file__),
"..",
"..",
"..",
"packer")))
import sys
if modpath not in sys.path:
sys.path.append(modpath)
del modpath
import packer
import blendfile_pack
print(" Source path:", filepath)
print(" Zip path:", filepath_zip)
try:
yield from packer.pack(
yield from blendfile_pack.pack(
filepath.encode('utf-8'), filepath_zip[-1].encode('utf-8'), mode='ZIP',
# TODO(cam) this just means the json is written in the zip
deps_remap={}, paths_remap={}, paths_uuid={},