diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2008-10-10 02:28:44 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2008-10-10 02:28:44 +0400 |
commit | e5d1c5a176607f8e4b2ee8a918734e8588d6a4b4 (patch) | |
tree | c9eaae298bbb3d54c133ff86309b8d8121e1caae /release | |
parent | 0d23e3436250e5b410e6077e99ddaeee8d2fb8b4 (diff) |
== Python ==
Bug: [#17734] Loading a python script's help dosn't work
reported by Rian Tut (thanks).
Actual problem: scripts with spaces in their filenames were not supported by the code that registers scripts in menus and runs them. Added support w/o breaking eventual, rare scripts that parse the Bpymenus file. They will still need an update to support filenames with spaces, like done here for these scripts: Scripts Help Browser and Scripts Config Editor.
PS: tested on Linux. Please test on other platforms: just make sure scripts still appear in menus (the File->Export, for example), even after re-registering them (Scripts window -> Scripts Menu -> Update Menus) and that the Scripts Help Browser still works.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/config.py | 4 | ||||
-rw-r--r-- | release/scripts/help_browser.py | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/release/scripts/config.py b/release/scripts/config.py index 4251bad8654..cbf8e272b91 100644 --- a/release/scripts/config.py +++ b/release/scripts/config.py @@ -246,6 +246,10 @@ information about how to fix this. fields = fields[2].split() if len(fields) > 1: fname = fields[1].split(sep)[-1] + i = 1 + while not fname.endswith('.py'): + i += 1 + fname = "%s %s" % (fname, fields[i]) ALL_SCRIPTS[fname] = (menuname, group_len - 1) return True diff --git a/release/scripts/help_browser.py b/release/scripts/help_browser.py index 696dfd3ca2b..b27e266f368 100644 --- a/release/scripts/help_browser.py +++ b/release/scripts/help_browser.py @@ -448,11 +448,19 @@ def parse_help_info(script): def parse_script_line(l): + tip = 'No tooltip' try: pieces = l.split("'") name = pieces[1].replace('...','') - version, fname, userdir = pieces[2].strip().split() - tip = pieces[3] + data = pieces[2].strip().split() + version = data[0] + userdir = data[-1] + fname = data[1] + i = 1 + while not fname.endswith('.py'): + i += 1 + fname = '%s %s' % (fname, data[i]) + if len(pieces) > 3: tip = pieces[3] except: return None |