pep8 cleanup

This commit is contained in:
Campbell Barton 2011-01-01 07:20:34 +00:00
parent 2840e7b764
commit 7f3fe8a2df
47 changed files with 288 additions and 303 deletions

@ -57,7 +57,7 @@ for line in infile.readlines():
infile.close() infile.close()
# Major was changed to float, but minor is still a string # Major was changed to float, but minor is still a string
# Note: removed returning minor, this messes up with install path code in BLI module # Note: removed returning minor, messes up install path code in BLI module
if major: if major:
print "%.2f" % major print "%.2f" % major
else: else:

@ -27,6 +27,7 @@ The main function to use is: update_data_paths(...)
IS_TESTING = False IS_TESTING = False
class DataPathBuilder(object): class DataPathBuilder(object):
__slots__ = ("data_path", ) __slots__ = ("data_path", )
""" Dummy class used to parse fcurve and driver data paths. """ Dummy class used to parse fcurve and driver data paths.
@ -183,8 +184,6 @@ def update_data_paths(rna_update):
tar.data_path = data_path_new tar.data_path = data_path_new
print("driver (%s): %s -> %s" % (id_data_other.name, data_path, data_path_new)) print("driver (%s): %s -> %s" % (id_data_other.name, data_path, data_path_new))
for action in anim_data_actions(anim_data): for action in anim_data_actions(anim_data):
for fcu in action.fcurves: for fcu in action.fcurves:
data_path = fcu.data_path data_path = fcu.data_path

@ -144,7 +144,6 @@ class bpy_ops_submodule_op(object):
for scene in bpy.data.scenes: for scene in bpy.data.scenes:
scene.update() scene.update()
__doc__ = property(_get_doc) __doc__ = property(_get_doc)
def __init__(self, module, func): def __init__(self, module, func):
@ -196,7 +195,8 @@ class bpy_ops_submodule_op(object):
as_string = op_as_string(idname) as_string = op_as_string(idname)
op_class = getattr(bpy.types, idname) op_class = getattr(bpy.types, idname)
descr = op_class.bl_rna.description descr = op_class.bl_rna.description
# XXX, workaround for not registering every __doc__ to save time on load. # XXX, workaround for not registering
# every __doc__ to save time on load.
if not descr: if not descr:
descr = op_class.__doc__ descr = op_class.__doc__
if not descr: if not descr:

@ -31,6 +31,7 @@ import bpy as _bpy
import os as _os import os as _os
import sys as _sys import sys as _sys
def _test_import(module_name, loaded_modules): def _test_import(module_name, loaded_modules):
import traceback import traceback
import time import time
@ -203,13 +204,11 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
# deal with addons seperately # deal with addons seperately
addon_reset_all(reload_scripts) addon_reset_all(reload_scripts)
# run the active integration preset # run the active integration preset
filepath = preset_find(_bpy.context.user_preferences.inputs.active_keyconfig, "keyconfig") filepath = preset_find(_bpy.context.user_preferences.inputs.active_keyconfig, "keyconfig")
if filepath: if filepath:
keyconfig_set(filepath) keyconfig_set(filepath)
if reload_scripts: if reload_scripts:
import gc import gc
print("gc.collect() -> %d" % gc.collect()) print("gc.collect() -> %d" % gc.collect())
@ -368,7 +367,6 @@ def addon_enable(module_name, default_set=True):
import bpy_types as _bpy_types import bpy_types as _bpy_types
import imp import imp
_bpy_types._register_immediate = False _bpy_types._register_immediate = False
def handle_error(): def handle_error():
@ -376,7 +374,6 @@ def addon_enable(module_name, default_set=True):
traceback.print_exc() traceback.print_exc()
_bpy_types._register_immediate = True _bpy_types._register_immediate = True
# reload if the mtime changes # reload if the mtime changes
mod = sys.modules.get(module_name) mod = sys.modules.get(module_name)
if mod: if mod:
@ -595,4 +592,3 @@ def user_resource(type, path="", create=False):
target_path = "" target_path = ""
return target_path return target_path

@ -25,16 +25,19 @@ import bgl
import sys import sys
def cutPoint(text, length): def cutPoint(text, length):
"Returns position of the last space found before 'length' chars" "Returns position of the last space found before 'length' chars"
l = length l = length
c = text[l] c = text[l]
while c != ' ': while c != ' ':
l -= 1 l -= 1
if l == 0: return length # no space found if l == 0:
return length # no space found
c = text[l] c = text[l]
return l return l
def textWrap(text, length=70): def textWrap(text, length=70):
lines = [] lines = []
while len(text) > 70: while len(text) > 70:
@ -44,6 +47,7 @@ def textWrap(text, length = 70):
lines.append(text) lines.append(text)
return lines return lines
def write_sysinfo(op): def write_sysinfo(op):
output_filename = "system-info.txt" output_filename = "system-info.txt"
warnings = 0 warnings = 0

@ -699,5 +699,6 @@ class UpdateAnimData(bpy.types.Operator):
if __name__ == "__main__": if __name__ == "__main__":
bpy.ops.anim.update_data_paths() bpy.ops.anim.update_data_paths()
def register(): def register():
pass pass

@ -35,8 +35,8 @@ class bvh_node_class(object):
'children', # a list of children of this type. 'children', # a list of children of this type.
'rest_head_world', # worldspace rest location for the head of this node 'rest_head_world', # worldspace rest location for the head of this node
'rest_head_local', # localspace rest location for the head of this node 'rest_head_local', # localspace rest location for the head of this node
'rest_tail_world',# # worldspace rest location for the tail of this node 'rest_tail_world', # worldspace rest location for the tail of this node
'rest_tail_local',# # worldspace rest location for the tail of this node 'rest_tail_local', # worldspace rest location for the tail of this node
'channels', # list of 6 ints, -1 for an unused channel, otherwise an index for the BVH motion data lines, lock triple then rot triple 'channels', # list of 6 ints, -1 for an unused channel, otherwise an index for the BVH motion data lines, lock triple then rot triple
'rot_order', # a triple of indicies as to the order rotation is applied. [0,1,2] is x/y/z - [None, None, None] if no rotation. 'rot_order', # a triple of indicies as to the order rotation is applied. [0,1,2] is x/y/z - [None, None, None] if no rotation.
'anim_data', # a list one tuple's one for each frame. (locx, locy, locz, rotx, roty, rotz) 'anim_data', # a list one tuple's one for each frame. (locx, locy, locz, rotx, roty, rotz)
@ -58,7 +58,6 @@ class bvh_node_class(object):
self.has_loc = channels[0] != -1 or channels[1] != -1 or channels[2] != -1 self.has_loc = channels[0] != -1 or channels[1] != -1 or channels[2] != -1
self.has_rot = channels[3] != -1 or channels[4] != -1 or channels[5] != -1 self.has_rot = channels[3] != -1 or channels[4] != -1 or channels[5] != -1
self.children = [] self.children = []
# list of 6 length tuples: (lx,ly,lz, rx,ry,rz) # list of 6 length tuples: (lx,ly,lz, rx,ry,rz)
@ -105,9 +104,7 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
# Split by whitespace. # Split by whitespace.
file_lines = [ll for ll in [l.split() for l in file_lines] if ll] file_lines = [ll for ll in [l.split() for l in file_lines] if ll]
# Create Hirachy as empties # Create Hirachy as empties
if file_lines[0][0].lower() == 'hierarchy': if file_lines[0][0].lower() == 'hierarchy':
#print 'Importing the BVH Hierarchy for:', file_path #print 'Importing the BVH Hierarchy for:', file_path
pass pass
@ -119,7 +116,6 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
channelIndex = -1 channelIndex = -1
lineIdx = 0 # An index for the file. lineIdx = 0 # An index for the file.
while lineIdx < len(file_lines) - 1: while lineIdx < len(file_lines) - 1:
#... #...
@ -175,7 +171,6 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
my_parent = bvh_nodes_serial[-1] # account for none my_parent = bvh_nodes_serial[-1] # account for none
# Apply the parents offset accumletivly # Apply the parents offset accumletivly
if my_parent is None: if my_parent is None:
rest_head_world = Vector(rest_head_local) rest_head_world = Vector(rest_head_local)
@ -195,7 +190,6 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
bvh_nodes_serial[-1].rest_tail_world = bvh_nodes_serial[-1].rest_head_world + rest_tail bvh_nodes_serial[-1].rest_tail_world = bvh_nodes_serial[-1].rest_head_world + rest_tail
bvh_nodes_serial[-1].rest_tail_local = bvh_nodes_serial[-1].rest_head_local + rest_tail bvh_nodes_serial[-1].rest_tail_local = bvh_nodes_serial[-1].rest_head_local + rest_tail
# Just so we can remove the Parents in a uniform way- End end never has kids # Just so we can remove the Parents in a uniform way- End end never has kids
# so this is a placeholder # so this is a placeholder
bvh_nodes_serial.append(None) bvh_nodes_serial.append(None)

@ -36,7 +36,6 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
def rvec3d(v): def rvec3d(v):
return round(v[0], 6), round(v[1], 6), round(v[2], 6) return round(v[0], 6), round(v[1], 6), round(v[2], 6)
def rvec2d(v): def rvec2d(v):
return round(v[0], 6), round(v[1], 6) return round(v[0], 6), round(v[1], 6)
@ -102,7 +101,6 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
vert_count = 0 vert_count = 0
for i, f in enumerate(mesh.faces): for i, f in enumerate(mesh.faces):
smooth = f.use_smooth smooth = f.use_smooth
if not smooth: if not smooth:
normal = tuple(f.normal) normal = tuple(f.normal)
@ -136,7 +134,6 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
color = col[j] color = col[j]
color = int(color[0] * 255.0), int(color[1] * 255.0), int(color[2] * 255.0) color = int(color[0] * 255.0), int(color[1] * 255.0), int(color[2] * 255.0)
key = normal_key, uvcoord_key, color key = normal_key, uvcoord_key, color
vdict_local = vdict[vidx] vdict_local = vdict[vidx]

@ -66,9 +66,11 @@ class Export3DS(bpy.types.Operator, ExportHelper):
def menu_func_export(self, context): def menu_func_export(self, context):
self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)") self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)")
def menu_func_import(self, context): def menu_func_import(self, context):
self.layout.operator(Import3DS.bl_idname, text="3D Studio (.3ds)") self.layout.operator(Import3DS.bl_idname, text="3D Studio (.3ds)")
def register(): def register():
bpy.types.INFO_MT_file_import.append(menu_func_import) bpy.types.INFO_MT_file_import.append(menu_func_import)
bpy.types.INFO_MT_file_export.append(menu_func_export) bpy.types.INFO_MT_file_export.append(menu_func_export)
@ -84,4 +86,3 @@ def unregister():
if __name__ == "__main__": if __name__ == "__main__":
register() register()

@ -53,7 +53,6 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default=True) POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default=True)
IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default=True) IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default=True)
def execute(self, context): def execute(self, context):
# print("Selected: " + context.active_object.name) # print("Selected: " + context.active_object.name)
from . import import_obj from . import import_obj
@ -99,7 +98,6 @@ class ExportOBJ(bpy.types.Operator, ExportHelper):
group_by_material = BoolProperty(name="Material Groups", description="", default=False) group_by_material = BoolProperty(name="Material Groups", description="", default=False)
keep_vertex_order = BoolProperty(name="Keep Vertex Order", description="", default=False) keep_vertex_order = BoolProperty(name="Keep Vertex Order", description="", default=False)
def execute(self, context): def execute(self, context):
from . import export_obj from . import export_obj
return export_obj.save(self, context, **self.as_keywords(ignore=("check_existing", "filter_glob"))) return export_obj.save(self, context, **self.as_keywords(ignore=("check_existing", "filter_glob")))
@ -117,6 +115,7 @@ def register():
bpy.types.INFO_MT_file_import.append(menu_func_import) bpy.types.INFO_MT_file_import.append(menu_func_import)
bpy.types.INFO_MT_file_export.append(menu_func_export) bpy.types.INFO_MT_file_export.append(menu_func_export)
def unregister(): def unregister():
bpy.types.INFO_MT_file_import.remove(menu_func_import) bpy.types.INFO_MT_file_import.remove(menu_func_import)
bpy.types.INFO_MT_file_export.remove(menu_func_export) bpy.types.INFO_MT_file_export.remove(menu_func_export)

@ -789,7 +789,6 @@ def _write(context, filepath,
EXPORT_POLYGROUPS, EXPORT_POLYGROUPS,
EXPORT_CURVE_AS_NURBS) EXPORT_CURVE_AS_NURBS)
scene.frame_set(orig_frame, 0.0) scene.frame_set(orig_frame, 0.0)
# Restore old active scene. # Restore old active scene.

@ -58,6 +58,7 @@ class ImportMDD(bpy.types.Operator, ImportHelper):
from . import import_mdd from . import import_mdd
return import_mdd.load(self, context, **self.as_keywords(ignore=("filter_glob",))) return import_mdd.load(self, context, **self.as_keywords(ignore=("filter_glob",)))
class ExportMDD(bpy.types.Operator, ExportHelper): class ExportMDD(bpy.types.Operator, ExportHelper):
'''Animated mesh to MDD vertex keyframe file''' '''Animated mesh to MDD vertex keyframe file'''
bl_idname = "export_shape.mdd" bl_idname = "export_shape.mdd"

@ -74,13 +74,11 @@ def load(operator, context, filepath, frame_start=0, frame_step=1):
verts = obj.data.shape_keys.keys[len(obj.data.shape_keys.keys) - 1].data verts = obj.data.shape_keys.keys[len(obj.data.shape_keys.keys) - 1].data
for v in verts: # 12 is the size of 3 floats for v in verts: # 12 is the size of 3 floats
v.co[:] = unpack('>3f', file.read(12)) v.co[:] = unpack('>3f', file.read(12))
#me.update() #me.update()
obj.show_only_shape_key = False obj.show_only_shape_key = False
# insert keyframes # insert keyframes
shape_keys = obj.data.shape_keys shape_keys = obj.data.shape_keys
@ -98,7 +96,6 @@ def load(operator, context, filepath, frame_start=0, frame_step=1):
obj.data.update() obj.data.update()
for i in range(frames): for i in range(frames):
UpdateMesh(obj, i) UpdateMesh(obj, i)

@ -552,7 +552,6 @@ class IsolateTypeRender(bpy.types.Operator):
return {'FINISHED'} return {'FINISHED'}
class ClearAllRestrictRender(bpy.types.Operator): class ClearAllRestrictRender(bpy.types.Operator):
'''Reveal all render objects by setting the hide render flag''' '''Reveal all render objects by setting the hide render flag'''
bl_idname = "object.hide_render_clear_all" bl_idname = "object.hide_render_clear_all"

@ -156,9 +156,7 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to):
obj.location[0] = loc_x obj.location[0] = loc_x
if align_y: if align_y:
# Align Mode # Align Mode
if relative_to == 'OPT_4': # Active relative if relative_to == 'OPT_4': # Active relative
@ -194,11 +192,8 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to):
obj.location[1] = loc_y obj.location[1] = loc_y
if align_z: if align_z:
# Align Mode # Align Mode
if relative_to == 'OPT_4': # Active relative if relative_to == 'OPT_4': # Active relative
if align_mode == 'OPT_1': if align_mode == 'OPT_1':
obj_z = obj_loc[2] - negative_z - size_active_z obj_z = obj_loc[2] - negative_z - size_active_z

@ -86,6 +86,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even):
from bpy.props import * from bpy.props import *
class RandomizeLocRotSize(bpy.types.Operator): class RandomizeLocRotSize(bpy.types.Operator):
'''Randomize objects loc/rot/scale''' '''Randomize objects loc/rot/scale'''
bl_idname = "object.randomize_transform" bl_idname = "object.randomize_transform"

@ -352,6 +352,7 @@ class WM_MT_operator_presets(bpy.types.Menu):
preset_operator = "script.execute_preset" preset_operator = "script.execute_preset"
def register(): def register():
pass pass

@ -21,6 +21,7 @@
import bpy import bpy
from bpy.props import * from bpy.props import *
def write_svg(fw, mesh, image_width, image_height, face_iter): def write_svg(fw, mesh, image_width, image_height, face_iter):
# for making an XML compatible string # for making an XML compatible string
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
@ -126,7 +127,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
for f in mesh_source.faces: for f in mesh_source.faces:
tot_verts += len(f.vertices) tot_verts += len(f.vertices)
faces_source = mesh_source.faces faces_source = mesh_source.faces
# get unique UV's incase there are many overlapping which slow down filling. # get unique UV's incase there are many overlapping which slow down filling.
@ -145,7 +145,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
mesh_new_materials = [] mesh_new_materials = []
mesh_new_face_vertices = [] mesh_new_face_vertices = []
current_vert = 0 current_vert = 0
for face_data in face_hash_3: for face_data in face_hash_3:
@ -181,7 +180,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
obj_wire.material_slots[0].link = 'OBJECT' obj_wire.material_slots[0].link = 'OBJECT'
obj_wire.material_slots[0].material = material_wire obj_wire.material_slots[0].material = material_wire
# setup the camera # setup the camera
cam = bpy.data.cameras.new("uv_temp") cam = bpy.data.cameras.new("uv_temp")
cam.type = 'ORTHO' cam.type = 'ORTHO'
@ -204,7 +202,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
material_wire.use_shadeless = True material_wire.use_shadeless = True
material_wire.diffuse_color = 0, 0, 0 material_wire.diffuse_color = 0, 0, 0
# scene render settings # scene render settings
scene.render.use_raytrace = False scene.render.use_raytrace = False
scene.render.alpha_mode = 'STRAIGHT' scene.render.alpha_mode = 'STRAIGHT'
@ -242,7 +239,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
bpy.data.materials.remove(mat_solid) bpy.data.materials.remove(mat_solid)
class ExportUVLayout(bpy.types.Operator): class ExportUVLayout(bpy.types.Operator):
"""Export UV layout to file""" """Export UV layout to file"""
@ -328,7 +324,6 @@ class ExportUVLayout(bpy.types.Operator):
if is_editmode: if is_editmode:
bpy.ops.object.mode_set(mode='OBJECT', toggle=False) bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
mesh = obj.data mesh = obj.data
mode = self.mode mode = self.mode

@ -102,6 +102,7 @@ class BRUSH_OT_set_active_number(bpy.types.Operator):
return {'CANCELLED'} return {'CANCELLED'}
class WM_OT_context_set_boolean(bpy.types.Operator): class WM_OT_context_set_boolean(bpy.types.Operator):
'''Set a context value.''' '''Set a context value.'''
bl_idname = "wm.context_set_boolean" bl_idname = "wm.context_set_boolean"
@ -668,7 +669,6 @@ class WM_OT_doc_edit(bpy.types.Operator):
return wm.invoke_props_dialog(self, width=600) return wm.invoke_props_dialog(self, width=600)
from bpy.props import * from bpy.props import *
@ -803,6 +803,7 @@ class WM_OT_keyconfig_activate(bpy.types.Operator):
bpy.utils.keyconfig_set(self.filepath) bpy.utils.keyconfig_set(self.filepath)
return {'FINISHED'} return {'FINISHED'}
class WM_OT_sysinfo(bpy.types.Operator): class WM_OT_sysinfo(bpy.types.Operator):
'''Generate System Info''' '''Generate System Info'''
bl_idname = "wm.sysinfo" bl_idname = "wm.sysinfo"
@ -813,6 +814,7 @@ class WM_OT_sysinfo(bpy.types.Operator):
sys_info.write_sysinfo(self) sys_info.write_sysinfo(self)
return {'FINISHED'} return {'FINISHED'}
def register(): def register():
pass pass

@ -69,6 +69,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel, bpy.types.Panel):
layout.prop(ob, "rotation_mode") layout.prop(ob, "rotation_mode")
class OBJECT_PT_delta_transform(ObjectButtonsPanel, bpy.types.Panel): class OBJECT_PT_delta_transform(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Delta Transform" bl_label = "Delta Transform"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}

@ -551,7 +551,6 @@ class ConstraintButtonsPanel():
col.prop(con, "axis_y", text="Y") col.prop(con, "axis_y", text="Y")
col.prop(con, "axis_z", text="Z") col.prop(con, "axis_z", text="Z")
if con.pivot_type == 'CONE_TWIST': if con.pivot_type == 'CONE_TWIST':
layout.label(text="Limits:") layout.label(text="Limits:")
split = layout.split() split = layout.split()

@ -143,7 +143,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
split.prop(tex, "type", text="") split.prop(tex, "type", text="")
class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel): class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Preview" bl_label = "Preview"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}

@ -20,6 +20,7 @@
import bpy import bpy
# used for DopeSheet, NLA, and Graph Editors # used for DopeSheet, NLA, and Graph Editors
def dopesheet_filter(layout, context): def dopesheet_filter(layout, context):
dopesheet = context.space_data.dopesheet dopesheet = context.space_data.dopesheet

@ -251,6 +251,7 @@ class IMAGE_MT_uvs(bpy.types.Menu):
layout.menu("IMAGE_MT_uvs_showhide") layout.menu("IMAGE_MT_uvs_showhide")
class IMAGE_MT_uvs_select_mode(bpy.types.Menu): class IMAGE_MT_uvs_select_mode(bpy.types.Menu):
bl_label = "UV Select Mode" bl_label = "UV Select Mode"

@ -69,7 +69,6 @@ class INFO_HT_header(bpy.types.Header):
# XXX: this should be right-aligned to the RHS of the region # XXX: this should be right-aligned to the RHS of the region
layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER', text="") layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER', text="")
# XXX: BEFORE RELEASE, MOVE FILE MENU OUT OF INFO!!! # XXX: BEFORE RELEASE, MOVE FILE MENU OUT OF INFO!!!
""" """
row = layout.row(align=True) row = layout.row(align=True)
@ -220,6 +219,7 @@ class INFO_MT_curve_add(bpy.types.Menu):
layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle") layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path") layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
class INFO_MT_edit_curve_add(bpy.types.Menu): class INFO_MT_edit_curve_add(bpy.types.Menu):
bl_idname = "INFO_MT_edit_curve_add" bl_idname = "INFO_MT_edit_curve_add"
bl_label = "Add" bl_label = "Add"

@ -684,7 +684,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel):
layout.template_ID(strip, "scene_camera") layout.template_ID(strip, "scene_camera")
sce = strip.scene sce = strip.scene
layout.label(text="Original frame range: "+ str(sce.frame_start) +" - "+ str(sce.frame_end) + " (" + str(sce.frame_end-sce.frame_start+1) + ")") layout.label(text="Original frame range: %d-%d (%d)" % (sce.frame_start, sce.frame_end, sce.frame_end - sce.frame_start + 1))
class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel):

@ -808,6 +808,7 @@ class USERPREF_PT_input(InputKeyMapPanel):
#print("runtime", time.time() - start) #print("runtime", time.time() - start)
class USERPREF_MT_addons_dev_guides(bpy.types.Menu): class USERPREF_MT_addons_dev_guides(bpy.types.Menu):
bl_label = "Addons develoment guides" bl_label = "Addons develoment guides"
@ -956,8 +957,8 @@ class USERPREF_PT_addons(bpy.types.Panel):
# menu to open webpages with addons development guides # menu to open webpages with addons development guides
col.separator() col.separator()
col.label(text = ' Online Documentation', icon = 'INFO') col.label(text=" Online Documentation", icon='INFO')
col.menu('USERPREF_MT_addons_dev_guides', text='Addons Developer Guides') col.menu("USERPREF_MT_addons_dev_guides", text="Addons Developer Guides")
col = split.column() col = split.column()

@ -128,6 +128,7 @@ class USERPREF_MT_keyconfigs(bpy.types.Menu):
bl_label = "KeyPresets" bl_label = "KeyPresets"
preset_subdir = "keyconfig" preset_subdir = "keyconfig"
preset_operator = "wm.keyconfig_activate" preset_operator = "wm.keyconfig_activate"
def draw(self, context): def draw(self, context):
props = self.layout.operator("wm.context_set_value", text="Blender (default)") props = self.layout.operator("wm.context_set_value", text="Blender (default)")
props.data_path = "window_manager.keyconfigs.active" props.data_path = "window_manager.keyconfigs.active"

@ -647,6 +647,7 @@ class VIEW3D_MT_select_face(bpy.types.Menu): # XXX no matching enum
# ********** Object menu ********** # ********** Object menu **********
class VIEW3D_MT_object(bpy.types.Menu): class VIEW3D_MT_object(bpy.types.Menu):
bl_context = "objectmode" bl_context = "objectmode"
bl_label = "Object" bl_label = "Object"

@ -48,7 +48,7 @@ def file_list_py(path):
def is_pep8(path): def is_pep8(path):
print(path) print(path)
f = open(path, 'r') f = open(path, 'r', encoding="utf8")
for i in range(PEP8_SEEK_COMMENT): for i in range(PEP8_SEEK_COMMENT):
line = f.readline() line = f.readline()
if line.startswith("# <pep8"): if line.startswith("# <pep8"):