~ubuntu-branches/ubuntu/intrepid/blender/intrepid-updates

« back to all changes in this revision

Viewing changes to release/scripts/save_theme.py

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-08-08 02:45:40 UTC
  • mfrom: (12.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080808024540-kkjp7ekfivzhuw3l
Tags: 2.46+dfsg-4
* Fix python syntax warning in import_dxf.py, which led to nasty output
  in installation/upgrade logs during byte-compilation, using a patch
  provided by the script author (Closes: #492280):
   - debian/patches/45_fix_python_syntax_warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
"""
4
4
Name: 'Save Current Theme...'
5
 
Blender: 240
 
5
Blender: 242
6
6
Group: 'Export'
7
7
Tooltip: 'Save current theme as a BPython script'
8
8
"""
9
9
 
10
10
__author__ = "Willian P. Germano"
11
 
__url__ = ("blender", "elysiun")
12
 
__version__ = "2.41 2006/01/16"
 
11
__url__ = ("blender", "blenderartists.org")
 
12
__version__ = "2.43 2006/12/30"
13
13
 
14
14
__bpydoc__ = """\
15
15
This script saves the current Theme in Blender as a Blender Python script.
36
36
some information on it before sharing it with others.
37
37
"""
38
38
 
39
 
# $Id: save_theme.py,v 1.10 2006/01/29 19:17:53 ianwill Exp $
 
39
# $Id: save_theme.py 14530 2008-04-23 14:04:05Z campbellbarton $
40
40
#
41
41
# --------------------------------------------------------------------------
42
42
# Copyright (C) 2004: Willian P. Germano, wgermano _at_ ig com br
73
73
 
74
74
# default filename: theme's name + '_theme.py' in user's scripts dir:
75
75
default_fname = Blender.Get("scriptsdir")
76
 
default_fname = Blender.sys.join(default_fname, theme.name + '_theme.py')
 
76
if (default_fname):
 
77
        default_fname = Blender.sys.join(default_fname, theme.name + '_theme.py')
 
78
else:
 
79
        default_fname = theme.name + '_theme.py'
 
80
        
77
81
default_fname = default_fname.replace(' ','_')
78
82
 
79
83
def write_theme(filename):
87
91
 
88
92
# \"\"\"
89
93
# Name: '%s'
90
 
# Blender: 241
 
94
# Blender: 242
91
95
# Group: 'Themes'
92
96
# Tooltip: 'Change current theme'
93
97
# \"\"\"
94
98
 
95
99
__%s__ = "????"
96
 
__%s__ = "2.41"
 
100
__%s__ = "2.43"
97
101
__%s__ = ["blender"]
98
102
__%s__ = \"\"\"\\
99
103
You can edit this section to write something about your script that can
124
128
                for var in vars:
125
129
                        v = "%s.%s" % (tsp, var)
126
130
                        exec("value = %s" % v)
127
 
                        fout.write("%s = %s\n" % (v, value))
 
131
                        if type(value) == str:
 
132
                                fout.write("%s = '%s'\n" % (v, value))
 
133
                        else:
 
134
                                fout.write("%s = %s\n" % (v, value))
128
135
 
129
136
        fout.write('\nBlender.Redraw(-1)')
130
137
        fout.close()