Title: Signature.html
Marc, I'm reaching back here, since something seems to have gone awry. I'm looking at the code for Global_Config1.py. When I execute it from IDLE, I get again:
...
  File "C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\configobj.py", line 1637, in _parse
    ParseError, infile, cur_index)
  File "C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\configobj.py", line 1748, in _handle_error
    raise error
ParseError: Invalid line at line "1".   <<--- same old, same old
However, we know IDLE can goof up. So I thought I'd execute the code by double clicking on the file. A black window appears briefly, then disappears. I have raw_input and other tricks to see if I could slow it down.  Finally, I went to the MS Command prompt window, and executed the py file from there. I get exactly the same message (s) as above. I don't recall if you tried the program on your system. Comments?


Marc Tompkins wrote:
On Wed, Feb 18, 2009 at 7:42 PM, Wayne Watson <sierra_mtnv...@sbcglobal.net> wrote:
I took your "starter" code, and formatted it to be what I hope is an acceptable program, Gobal_Config.py. See attached.  I'm using Python 2.5.2. I put the two modules in the same folder with it, and executed it in IDLE. I got this:
  ...
  File "C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\configobj.py", line 1637, in _parse
    ParseError, infile, cur_index)
  File "C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\configobj.py", line 1748, in _handle_error
    raise error
ParseError: Invalid line at line "1".

As far as I can tell, line 1 of config.obj looks OK. It's a comment. Something is amiss.

I hate to say it, but IDLE is really holding you back.  It's convenient because it installs automagically with Python, but it does funky, confusing things - as in this case, where it's somehow stepped on the real error and assigned blame in the wrong place; you've already experienced its internal conflicts with Tkinter...  I use wxPython for my GUI goodness, and swear by SPE (Stani's Python Editor).  I don't want to re-ignite the IDE wars, but I definitely think you need to do yourself a favor and move away from IDLE.

Anyway, I didn't mean for that to be a standalone program, but to be picked apart into chunks and dropped into an existing program (or, actually, just to be used as an example - maybe of what _not_ to do, but an example...) 
First error:
    if argv is None:
       argv = sys.argv  <<== you haven't imported "sys"

Second error:
    app = MyApp(0)  <<== you haven't defined a class called "MyApp", so you can't do this...

So I cut it down to just this bit:
test = Global.cfgFile.validate(Global.vtor, copy=True)
Global.cfgFile.write()

(unindented all the way to the left, so that it executes as the main body of the program) and it works just fine... except:
Third error (well, issue not error):
Take all my comments out!  They weren't meant to be included in final code.  ConfigObj allows inline comments in your config file, and in the configspec - so my comments show up in there too.  Here's what Initial.sen ends up looking like:

mask_file_name = None
gray_scale = True
post_event_stack = False
post_event_format = Tiff 2
show_real_time = False
hourly_rate = 0
slowdown = 1    # I don't know what
#               this value is/does, so this is probably wrong
start_time = 00:00:00    # or you could make the default None?
stop_time = 00:00:00
    #               as a default latitude, if any...
I've cut everything down; I'm attaching it as Global_Config1.py (just to avoid confusion with the earlier version).  If you do actually want to use it as the basis of anything, you'll want to place the call to .validate() somewhere near the beginning of the action - remember, the call to .write() just afterward is completely optional; I had it in there for testing and have kept it in there for the same reason.
   
 
Does PYTHONPATH apply in Win XP? I haven't played at the level of paths for a long time in any OS. We can worry about an install "package" later for the modules. It might be best for the users of this program.

Ya know, I have no idea anymore.  I thought I knew - but I just did a SET from a command prompt, and I don't have a PYTHONPATH variable.  I seem to reacall something from a year or two ago... (looking now)  Oh yes - there's a directory under your Python directory (Python25 in my case) called "Lib", and a folder under that called "site-packages"; any text files with the extension ".pth" will be scaned for the names of folders to add to the search path.  As much as I love Python, I wish they'd get all this together...

--
www.fsrtechnologies.com

_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

--


           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
            

                "Nature, to be commanded, must be obeyed."
                                   -- Sir Francis Bacon 

                    Web Page: <www.speckledwithstars.net/>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to