Cleanup: pep8
This commit is contained in:
@@ -40,6 +40,7 @@ del os, sys, path
|
||||
class bam_config:
|
||||
# fake module
|
||||
__slots__ = ()
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
raise RuntimeError("%s should not be instantiated" % cls)
|
||||
|
||||
@@ -98,6 +99,7 @@ class bam_config:
|
||||
class bam_utils:
|
||||
# fake module
|
||||
__slots__ = ()
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
raise RuntimeError("%s should not be instantiated" % cls)
|
||||
|
||||
@@ -187,9 +189,6 @@ class bam_utils:
|
||||
print("Expected a directory (%r)" % path)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
|
||||
# make a zipfile from session
|
||||
import json
|
||||
with open(os.path.join(path, ".bam_paths_uuid.json")) as f:
|
||||
@@ -285,9 +284,11 @@ class bam_utils:
|
||||
if file_type != "dir":
|
||||
print(" %s" % name_short)
|
||||
|
||||
|
||||
def subcommand_checkout_cb(args):
|
||||
bam_utils.checkout(args.paths)
|
||||
|
||||
|
||||
def subcommand_commit_cb(args):
|
||||
bam_utils.commit(args.paths, args.message)
|
||||
|
||||
@@ -345,7 +346,6 @@ def create_argparse_revert(subparsers):
|
||||
subparse.set_defaults(func=subcommand_revert_cb)
|
||||
|
||||
|
||||
|
||||
def create_argparse_status(subparsers):
|
||||
subparse = subparsers.add_parser("status", aliases=("st",))
|
||||
subparse.add_argument(
|
||||
@@ -362,8 +362,6 @@ def create_argparse_list(subparsers):
|
||||
subparse.set_defaults(func=subcommand_list_cb)
|
||||
|
||||
|
||||
|
||||
|
||||
def create_argparse():
|
||||
import os
|
||||
import argparse
|
||||
|
@@ -10,6 +10,7 @@ with open(os.path.join(MODULE_DIR, 'config.json'), 'r') as config:
|
||||
import json
|
||||
config = json.load(config)
|
||||
|
||||
|
||||
def request_url(path):
|
||||
return ('%s%s' % (config['BAM_SERVER'], path))
|
||||
|
||||
@@ -45,7 +46,7 @@ def request_url(path):
|
||||
# )
|
||||
|
||||
args = {
|
||||
'message' : 'Adding test file.'
|
||||
'message': "Adding test file."
|
||||
}
|
||||
|
||||
payload = {
|
||||
|
@@ -103,7 +103,6 @@ class Application(tk.Frame):
|
||||
menubar.add_command(label="Preferences", command=lambda: print("Preferences"))
|
||||
root.config(menu=menubar)
|
||||
|
||||
|
||||
# local data
|
||||
self.item_list = []
|
||||
|
||||
@@ -224,7 +223,6 @@ class Application(tk.Frame):
|
||||
self.grid_members.append(but)
|
||||
row += 1
|
||||
|
||||
|
||||
def OnFrameConfigure(self, event):
|
||||
'''Reset the scroll region to encompass the inner frame'''
|
||||
self.canvas.configure(scrollregion=self.canvas.bbox("all"))
|
||||
|
@@ -136,7 +136,6 @@ class BlendFile:
|
||||
# cache (could lazy init, incase we never use?)
|
||||
self.block_from_offset = {block.addr_old: block for block in self.blocks if block.code != b'ENDB'}
|
||||
|
||||
|
||||
def find_blocks_from_code(self, code):
|
||||
assert(type(code) == bytes)
|
||||
if code not in self.code_index:
|
||||
@@ -243,7 +242,6 @@ class BlendFile:
|
||||
sdna_index_from_id[dna_struct.dna_type_id] = sdna_index
|
||||
structs.append(dna_struct)
|
||||
|
||||
|
||||
fields_len = d[1]
|
||||
dna_offset = 0
|
||||
|
||||
@@ -394,7 +392,6 @@ class BlendFileBlock:
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
# ----------------------
|
||||
# Python convenience API
|
||||
|
||||
@@ -481,7 +478,6 @@ class BlendFileHeader:
|
||||
)))
|
||||
|
||||
|
||||
|
||||
class DNAName:
|
||||
"""
|
||||
DNAName is a C-type name stored in the DNA
|
||||
|
@@ -21,8 +21,10 @@
|
||||
VERBOSE = True
|
||||
TIMEIT = True
|
||||
|
||||
|
||||
class C_defs:
|
||||
__slots__ = ()
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
raise RuntimeError("%s should not be instantiated" % cls)
|
||||
|
||||
@@ -570,7 +572,6 @@ class ExpandID:
|
||||
|
||||
yield block.get_pointer(b'group')
|
||||
|
||||
|
||||
@staticmethod
|
||||
def expand_TE(block): # 'Tex'
|
||||
yield from ExpandID._expand_generic_animdata(block)
|
||||
|
@@ -96,7 +96,6 @@ def pack(blendfile_src, blendfile_dst, mode='FILE',
|
||||
path_temp_files.add(filepath_tmp)
|
||||
return filepath_tmp
|
||||
|
||||
|
||||
# base_dir_src = os.path.dirname(blendfile_src)
|
||||
base_dir_dst = os.path.dirname(blendfile_dst)
|
||||
|
||||
@@ -184,7 +183,6 @@ def pack(blendfile_src, blendfile_dst, mode='FILE',
|
||||
del blendfile_dst_tmp
|
||||
del sha1_from_file
|
||||
|
||||
|
||||
# --------------------
|
||||
# Handle File Copy/Zip
|
||||
|
||||
@@ -232,6 +230,7 @@ def pack(blendfile_src, blendfile_dst, mode='FILE',
|
||||
|
||||
if WRITE_JSON_REMAP:
|
||||
import json
|
||||
|
||||
def write_dict_as_json(fn, dct):
|
||||
zip.writestr(
|
||||
fn,
|
||||
@@ -250,7 +249,6 @@ def pack(blendfile_src, blendfile_dst, mode='FILE',
|
||||
|
||||
del write_dict_as_json
|
||||
|
||||
|
||||
yield report(" %s: %r\n" % (colorize("written", color='green'), blendfile_dst))
|
||||
else:
|
||||
raise Exception("%s not a known mode" % mode)
|
||||
@@ -316,7 +314,6 @@ def main():
|
||||
sort_keys=True, indent=4, separators=(',', ': '),
|
||||
)
|
||||
|
||||
|
||||
if deps_remap is not None:
|
||||
write_dict_as_json(args.deps_remap, deps_remap)
|
||||
|
||||
|
@@ -44,6 +44,7 @@ auth = HTTPBasicAuth()
|
||||
import config
|
||||
app.config.from_object(config.Development)
|
||||
|
||||
|
||||
@api.representation('application/octet-stream')
|
||||
def output_file(data, code, headers=None):
|
||||
"""Makes a Flask response to return a file."""
|
||||
@@ -154,7 +155,6 @@ class FileAPI(Resource):
|
||||
elif command == 'checkout':
|
||||
filepath = os.path.join(app.config['STORAGE_PATH'], filepath)
|
||||
|
||||
|
||||
if not os.path.exists(filepath):
|
||||
return jsonify(message="Path not found %r" % filepath)
|
||||
elif os.path.isdir(filepath):
|
||||
|
Reference in New Issue
Block a user