diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-22 09:11:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-22 09:11:02 +0400 |
commit | 997ba458ec53f764c6660bb681840f2740cd3d91 (patch) | |
tree | f6e85d9c2a3879de4b8d7ab6e9a83ea6f1e23d8e /io_scene_x3d/export_x3d.py | |
parent | 1d95b9529ba793d98552aa661910d9865757f3d2 (diff) |
minor cleanup for x3d, dont use str as variable name and remove unneeded check
Diffstat (limited to 'io_scene_x3d/export_x3d.py')
-rw-r--r-- | io_scene_x3d/export_x3d.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index 1b8863a3..6152d9f2 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -89,14 +89,14 @@ def suffix_quoted_str(value, suffix): return value[:-1] + suffix + value[-1:] -def clean_def(str): +def clean_def(txt): # see report [#28256] - if not str: - str = "None" + if not txt: + txt = "None" # no digit start - if str[0] in "1234567890+-": - str = "_" + str - return str.translate({ # control characters 0x0-0x1f + if txt[0] in "1234567890+-": + txt = "_" + txt + return txt.translate({ # control characters 0x0-0x1f # 0x00: "_", 0x01: "_", 0x02: "_", @@ -1439,16 +1439,9 @@ def save(operator, context, filepath="", if bpy.ops.object.mode_set.poll(): bpy.ops.object.mode_set(mode='OBJECT') - file = None if use_compress: - try: - import gzip - file = gzip.open(filepath, 'w') - except: - print('failed to import compression modules, exporting uncompressed') - filepath = filepath[:-1] # remove trailing z - - if file is None: + file = gzip.open(filepath, 'w') + else: file = open(filepath, 'w') if global_matrix is None: |