View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011339 | Scribus | Scripter | public | 2013-01-06 16:30 | 2013-06-24 05:43 |
Reporter | niklausgiger | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.0svn | ||||
Fixed in Version | 1.5.0svn | ||||
Summary | 0011339: [PATCH] scripter2 should allow to read full path of running script | ||||
Description | If one wants to read files relative to the current script which is not distributed with Scribus, I did not find a way to read the filename/path of the currently open script, as the python __file__ does not work. Could you implement a helper function to access this value? | ||||
Tags | No tags attached. | ||||
Patch | |||||
|
__file__ was supposed to show the name of the current script, but there was a typo in the way the global values were passed. patch is attached. |
|
scripter__file__.diff (589 bytes)
Index: scribus/plugins/scripter/python/scripter_runtime.py =================================================================== --- scribus/plugins/scripter/python/scripter_runtime.py (revision 17926) +++ scribus/plugins/scripter/python/scripter_runtime.py (working copy) @@ -184,8 +184,8 @@ def run_python(filename, subroutine=None, extension=False): if not extension: namespace = { - __name__: "__scribus__", - __file__: filename + "__name__": "__scribus__", + "__file__": filename } else: namespace = extension_namespace |
|
Committed, thanks! |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-01-06 16:30 | niklausgiger | New Issue | |
2013-01-08 20:19 | ale | Note Added: 0029664 | |
2013-01-08 20:23 | ale | File Added: scripter__file__.diff | |
2013-01-08 20:25 | ale | Summary | scripter2 should allow to read full path of running script => [PATCH] scripter2 should allow to read full path of running script |
2013-01-08 22:30 | jghali | Note Added: 0029667 | |
2013-01-08 22:30 | jghali | Status | new => resolved |
2013-01-08 22:30 | jghali | Fixed in Version | => 1.5.0svn |
2013-01-08 22:30 | jghali | Resolution | open => fixed |
2013-01-08 22:30 | jghali | Assigned To | => jghali |
2013-06-24 05:43 | christoph_s | Status | resolved => closed |