ran through pep8 checker
This commit is contained in:
@@ -30,6 +30,7 @@ import sys as _sys
|
||||
from _bpy import blend_paths
|
||||
from _bpy import script_paths as _bpy_script_paths
|
||||
|
||||
|
||||
def _test_import(module_name, loaded_modules):
|
||||
import traceback
|
||||
import time
|
||||
@@ -49,7 +50,7 @@ def _test_import(module_name, loaded_modules):
|
||||
if _bpy.app.debug:
|
||||
print("time %s %.4f" % (module_name, time.time() - t))
|
||||
|
||||
loaded_modules.add(mod.__name__) # should match mod.__name__ too
|
||||
loaded_modules.add(mod.__name__) # should match mod.__name__ too
|
||||
return mod
|
||||
|
||||
|
||||
@@ -83,9 +84,10 @@ def modules_from_path(path, loaded_modules):
|
||||
modules.append(mod)
|
||||
|
||||
return modules
|
||||
|
||||
_global_loaded_modules = [] # store loaded module names for reloading.
|
||||
import bpy_types as _bpy_types # keep for comparisons, never ever reload this.
|
||||
|
||||
|
||||
_global_loaded_modules = [] # store loaded module names for reloading.
|
||||
import bpy_types as _bpy_types # keep for comparisons, never ever reload this.
|
||||
|
||||
|
||||
def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
@@ -109,7 +111,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
|
||||
if refresh_scripts:
|
||||
original_modules = _sys.modules.values()
|
||||
|
||||
|
||||
if reload_scripts:
|
||||
_bpy_types.TypeMap.clear()
|
||||
_bpy_types.PropertiesMap.clear()
|
||||
@@ -135,7 +137,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
traceback.print_exc()
|
||||
|
||||
def sys_path_ensure(path):
|
||||
if path not in _sys.path: # reloading would add twice
|
||||
if path not in _sys.path: # reloading would add twice
|
||||
_sys.path.insert(0, path)
|
||||
|
||||
def test_reload(mod):
|
||||
@@ -191,7 +193,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
continue
|
||||
|
||||
if user_path != base_path and path_subdir == "":
|
||||
continue # avoid loading 2.4x scripts
|
||||
continue # avoid loading 2.4x scripts
|
||||
|
||||
for mod in modules_from_path(path, loaded_modules):
|
||||
test_register(mod)
|
||||
@@ -212,12 +214,10 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
|
||||
if _bpy.app.debug:
|
||||
print("Python Script Load Time %.4f" % (time.time() - t_main))
|
||||
|
||||
|
||||
_bpy_types._register_immediate = True
|
||||
|
||||
|
||||
|
||||
|
||||
# base scripts
|
||||
_scripts = _os.path.join(_os.path.dirname(__file__), _os.path.pardir, _os.path.pardir)
|
||||
_scripts = (_os.path.normpath(_scripts), )
|
||||
@@ -265,7 +265,7 @@ def script_paths(subdir=None, user=True):
|
||||
return script_paths
|
||||
|
||||
|
||||
_presets = _os.path.join(_scripts[0], "presets") # FIXME - multiple paths
|
||||
_presets = _os.path.join(_scripts[0], "presets") # FIXME - multiple paths
|
||||
|
||||
|
||||
def preset_paths(subdir):
|
||||
@@ -295,10 +295,10 @@ def smpte_from_seconds(time, fps=None):
|
||||
else:
|
||||
neg = ""
|
||||
|
||||
if time >= 3600.0: # hours
|
||||
if time >= 3600.0: # hours
|
||||
hours = int(time / 3600.0)
|
||||
time = time % 3600.0
|
||||
if time >= 60.0: # mins
|
||||
if time >= 60.0: # mins
|
||||
minutes = int(time / 60.0)
|
||||
time = time % 60.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user