Here is a very simple example, this is the content of file "letter.txt":
Dear $(salutation) $(surname),
this is a simple pyexpander example.
Applying this command:
expander.py --eval 'salutation="Mr";surname="Smith"' -f letter.txt
gives this result:
Traceback (most recent call last):
File "C:\Python27\Scripts\expander.py", line 5, in <module>
pkg_resources.run_script('pyexpander==1.5.9', 'expander.py')
File "C:\Python27\lib\site-packages\pkg_resources.py", line 492, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1357, in run_script
exec_(script_code, namespace, namespace)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 47, in exec_
exec("""exec code in globs, locs""")
File "<string>", line 1, in <module>
File "C:\Python27\lib\site-packages\pyexpander-1.5.9-py2.7.egg\EGG-INFO\scripts\expander.py", line 110, in <module>
File "C:\Python27\lib\site-packages\pyexpander-1.5.9-py2.7.egg\EGG-INFO\scripts\expander.py", line 106, in main
File "C:\Python27\lib\site-packages\pyexpander-1.5.9-py2.7.egg\EGG-INFO\scripts\expander.py", line 41, in process_files
File "build\bdist.win32\egg\pyexpander.py", line 1407, in expandFile
File "build\bdist.win32\egg\pyexpander.py", line 1385, in processToPrint
File "build\bdist.win32\egg\pyexpander.py", line 1111, in processToList
if not block.skip:
File "build\bdist.win32\egg\pyexpander.py", line 388, in getitem
self.globals_[name]= val
NameError: name 'salutation' is not defined at file "letter.txt" line 1, col 8
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hello Konstantin,
I have closed the bug "#5 DOC typo".
Regarding your last mail I cannot recreate the error.
Here is my content of "letter.txt":
Dear $(salutation) $(surname),
this is a simple pyexpander example.
A call with
expander.py --eval 'salutation="Mr";surname="Smith"' -f letter.txt
gives this result:
Dear Mr Smith,
this is a simple pyexpander example.
I only get an error message like you when I use a wrong macro name on
purpose, e.g. in
expander.py --eval 'X="Mr";surname="Smith"' -f letter.txt
I use Fedora20 Linux and not windows, so it could have something to do
with the way the windows command line works. Maybe you can switch the
quote signs and try again like here:
expander.py --eval "X='Mr';surname='Smith'" -f letter.txt
Greetings
Goetz Pfeiffer
On 02/19/2014 03:38 PM, Konstantin wrote:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iF4EAREIAAYFAlMPW30ACgkQjELT8cZ2sb2TOgEAz3Xc3yomodimXFPCTFkFyVCb
7JWZDooH9TLSGIeu3rgA/Ah22Lg7PcoKmwUCqk14JBAiq2rygC9pBv+ZqBTDk14N
=G9gC
-----END PGP SIGNATURE-----
Under windows it stil not work ;(
I will try under ubuntu this eavening..
27 февр. 2014 г. 17:44 пользователь "Goetz Pfeiffer" goetzpf@users.sf.net
написал:
Related
Bugs: #6
Sorry!!
Under windows works fine with inversed quotes.
C:\Python27\Scripts\expander.py --eval "salutation='Mr';surname='Smith'" -f
letter.txt
Thanks!!
On 27 February 2014 19:49, Konstantin Kim kimstik@gmail.com wrote:
Related
Bugs: #6