View Issue Details

IDProjectCategoryView StatusLast Update
0011339ScribusScripterpublic2013-06-24 05:43
Reporterniklausgiger Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.0svn 
Fixed in Version1.5.0svn 
Summary0011339: [PATCH] scripter2 should allow to read full path of running script
DescriptionIf 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?
TagsNo tags attached.
Patch

Activities

ale

2013-01-08 20:19

manager   ~0029664

__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.

ale

2013-01-08 20:23

manager  

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
scripter__file__.diff (589 bytes)   

jghali

2013-01-08 22:30

administrator   ~0029667

Committed, thanks!

Issue History

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