Menu

#6 Example from introduction dont work..

v1.0_(example)
open
nobody
None
5
2014-02-19
2014-02-19
Konstantin
No

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

Related

Bugs: #6

Discussion

  • Goetz Pfeiffer

    Goetz Pfeiffer - 2014-02-27

    -----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:

    expander.py --eval 'salutation="Mr";surname="Smith"' -f letter.txt

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

     
    • Konstantin

      Konstantin - 2014-02-27

      Under windows it stil not work ;(
      I will try under ubuntu this eavening..
      27 февр. 2014 г. 17:44 пользователь "Goetz Pfeiffer" goetzpf@users.sf.net
      написал:

      -----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:

      expander.py --eval 'salutation="Mr";surname="Smith"' -f letter.txt

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

      Status: open
      Created: Wed Feb 19, 2014 02:38 PM UTC by Konstantin
      Last Updated: Wed Feb 19, 2014 02:38 PM UTC
      Owner: nobody

      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
      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 "", line 1, in
      File
      "C:\Python27\lib\site-packages\pyexpander-1.5.9-py2.7.egg\EGG-INFO\scripts\expander.py",
      line 110, in

      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


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/pyexpander/bugs/6/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #6

      • Konstantin

        Konstantin - 2014-02-27

        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:

        Under windows it stil not work ;(
        I will try under ubuntu this eavening..
        27 февр. 2014 г. 17:44 пользователь "Goetz Pfeiffer" goetzpf@users.sf.net написал:

        -----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:

        expander.py --eval 'salutation="Mr";surname="Smith"' -f letter.txt

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

        Status: open
        Created: Wed Feb 19, 2014 02:38 PM UTC by Konstantin
        Last Updated: Wed Feb 19, 2014 02:38 PM UTC
        Owner: nobody

        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
        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 "", line 1, in
        File
        "C:\Python27\lib\site-packages\pyexpander-1.5.9-py2.7.egg\EGG-INFO\scripts\expander.py",
        line 110, in

        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


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/pyexpander/bugs/6/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs: #6


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.