Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpo/clean_po.py16
-rwxr-xr-xpo/merge_po.py9
-rw-r--r--release/scripts/modules/bpy_extras/keyconfig_utils.py38
-rw-r--r--release/scripts/startup/bl_operators/screen_play_rendered_anim.py6
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py2
-rw-r--r--release/scripts/startup/bl_ui/space_userpref_keymap.py1
6 files changed, 35 insertions, 37 deletions
diff --git a/po/clean_po.py b/po/clean_po.py
index 2cbd2cb33ac..685ec585ffd 100755
--- a/po/clean_po.py
+++ b/po/clean_po.py
@@ -133,12 +133,12 @@ def do_clean(po, pot_messages):
if pot_messages.get(msgid):
t = po_messages.get(msgid)
if not t:
- print(('Reusing full item from commented ' + \
- 'lines for msgid \'%s\'') % (msgid))
+ print("Reusing full item from commented "
+ "lines for msgid '%s'" % msgid)
po_messages[msgid] = commented_messages[msgid]
elif not t['translation']:
- print(('Reusing translation from commented ' + \
- 'lines for msgid \'%s\'') % (msgid))
+ print("Reusing translation from commented "
+ "lines for msgid '%s'" % msgid)
m = commented_messages[msgid]
t['translation'] = m['translation']
t['translation_lines'] = m['translation_lines']
@@ -153,17 +153,17 @@ def do_clean(po, pot_messages):
first = True
for x in item['message_lines']:
if first:
- handle.write("msgid \"%s\"\n" % (x))
+ handle.write("msgid \"%s\"\n" % x)
else:
- handle.write("\"%s\"\n" % (x))
+ handle.write("\"%s\"\n" % x)
first = False
first = True
for x in item['translation_lines']:
if first:
- handle.write("msgstr \"%s\"\n" % (x))
+ handle.write("msgstr \"%s\"\n" % x)
else:
- handle.write("\"%s\"\n" % (x))
+ handle.write("\"%s\"\n" % x)
first = False
handle.write("\n")
diff --git a/po/merge_po.py b/po/merge_po.py
index b4a1ffa399e..b0b29a3ac8e 100755
--- a/po/merge_po.py
+++ b/po/merge_po.py
@@ -23,7 +23,6 @@
# update the pot file according the POTFILES.in
-import os
import sys
import collections
@@ -145,17 +144,17 @@ def main():
first = True
for x in item['message_lines']:
if first:
- handle.write("msgid \"%s\"\n" % (x))
+ handle.write("msgid \"%s\"\n" % x)
else:
- handle.write("\"%s\"\n" % (x))
+ handle.write("\"%s\"\n" % x)
first = False
first = True
for x in item['translation_lines']:
if first:
- handle.write("msgstr \"%s\"\n" % (x))
+ handle.write("msgstr \"%s\"\n" % x)
else:
- handle.write("\"%s\"\n" % (x))
+ handle.write("\"%s\"\n" % x)
first = False
handle.write("\n")
diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py
index e87db659918..78f010245a0 100644
--- a/release/scripts/modules/bpy_extras/keyconfig_utils.py
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py
@@ -119,14 +119,17 @@ def keyconfig_merge(kc1, kc2):
"""
merged_keymaps = [(km, kc1) for km in kc1.keymaps]
if kc1 != kc2:
- merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not _km_exists_in(km, merged_keymaps))
+ merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not km_exists_in(km, merged_keymaps))
return merged_keymaps
-def keyconfig_export(wm, kc, filepath):
+def _export_properties(prefix, properties, lines=None):
from bpy.types import OperatorProperties
+ if lines is None:
+ lines = []
+
def string_value(value):
if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int):
result = repr(value)
@@ -137,20 +140,19 @@ def keyconfig_export(wm, kc, filepath):
return result
- def export_properties(prefix, properties, lines=None):
- if lines is None:
- lines = []
-
- for pname in properties.bl_rna.properties.keys():
- if pname != "rna_type" and not properties.is_property_hidden(pname):
- value = getattr(properties, pname)
- if isinstance(value, OperatorProperties):
- export_properties(prefix + "." + pname, value, lines)
- elif properties.is_property_set(pname):
- value = string_value(value)
- if value != "":
- lines.append("%s.%s = %s\n" % (prefix, pname, value))
- return lines
+ for pname in properties.bl_rna.properties.keys():
+ if pname != "rna_type" and not properties.is_property_hidden(pname):
+ value = getattr(properties, pname)
+ if isinstance(value, OperatorProperties):
+ _export_properties(prefix + "." + pname, value, lines)
+ elif properties.is_property_set(pname):
+ value = string_value(value)
+ if value != "":
+ lines.append("%s.%s = %s\n" % (prefix, pname, value))
+ return lines
+
+
+def keyconfig_export(wm, kc, filepath):
f = open(filepath, "w")
@@ -209,7 +211,7 @@ def keyconfig_export(wm, kc, filepath):
props = kmi.properties
if props is not None:
- f.write("".join(export_properties("kmi.properties", props)))
+ f.write("".join(_export_properties("kmi.properties", props)))
f.write("\n")
@@ -246,7 +248,7 @@ def keyconfig_test(kc):
props = kmi.properties
if props is not None:
- export_properties("kmi.properties", props, s)
+ _export_properties("kmi.properties", props, s)
return "".join(s).strip()
diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index 3c5bc68203f..3479a3f9e53 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -136,7 +136,8 @@ class PlayRenderedAnim(Operator):
del process
# -----------------------------------------------------------------
- opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), "-j", str(scene.frame_step), file]
+ opts = ["-a", "-f", str(rd.fps), str(rd.fps_base),
+ "-j", str(scene.frame_step), file]
cmd.extend(opts)
elif preset == 'DJV':
opts = [file, "-playback_speed", "%d" % int(rd.fps / rd.fps_base)]
@@ -166,9 +167,8 @@ class PlayRenderedAnim(Operator):
print("Executing command:\n %r" % " ".join(cmd))
try:
- process = subprocess.Popen(cmd)
+ subprocess.Popen(cmd)
except Exception as e:
- import traceback
self.report({'ERROR'},
"Couldn't run external animation player with command "
"%r\n%s" % (" ".join(cmd), str(e)))
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 5670b912c7b..1ec6cc39164 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -22,8 +22,6 @@ from bpy.types import Header, Menu, Panel
import os
import addon_utils
-from bpy.props import StringProperty, BoolProperty, EnumProperty
-
def ui_items_general(col, context):
""" General UI Theme Settings (User Interface)
diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py
index 79b13e3bec0..25f955085f6 100644
--- a/release/scripts/startup/bl_ui/space_userpref_keymap.py
+++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Menu, OperatorProperties
-import os
class USERPREF_MT_keyconfigs(Menu):