[Tutor] Looking for ConfigObj Documentation

Marc Tompkins marc.tompkins at gmail.com
Fri Feb 20 21:58:00 CET 2009


On Fri, Feb 20, 2009 at 9:45 AM, Wayne Watson
<sierra_mtnview at sbcglobal.net>wrote:

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

First: the line "1" it's talking about is the first line of the config file,
not of configobj.py.
Second: as written, there's no GUI here, so we _expect_ it to briefly show a
black window, then close - but when it's done, there should be a file called
"Initial.sen" in the current directory, which will look like this (this is
the output on my machine):
"""

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
start_time = 00:00:00
stop_time = 00:00:00

"""
(I've added the triple quotes for visual clarity - they don't appear in the
actual file.)

I suspect that what's happening is that you already have a file called
Initial.sen, and its contents don't match the configspec.  So the ParseError
is an expected result - we either need to tweak the configspec to match your
previous file, or add exception handling, or (simplest) if you don't have
any real installed base, just start from scratch.

Do me two favors:
 - send your existing Initial.sen so I can look at modifying the configspec
or adding exception handling
 - delete or rename it, then try the program again.

-- 
www.fsrtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090220/6e8a3d70/attachment.htm>


More information about the Tutor mailing list