Greetings
Daniel
Thank you.
> If it would help you can get the code from www.uxpython.com/toolkit.
> It's not exactly the same but the code apydia is choking on has not
> changed. AFAIK.
>
> Thank you.
Grabbed the uxPython-tarball, tried to set it up, and figured out that
it
doesn't install as easily on my Mac as I hoped - actually pygtk fails,
not uxPython so far.
I need to setup an appropriate virtual Windows environment to test
this and can't promise when I will find the tie to do so.
Alternatively, if you could find out the filename and line number
(inside
Apydia) where it stalls (does ^C work?), we could narrow the problem
down?
I have however found the offending code after digging around:
in ModuleDesc:
-------------------------------------------------------------------
@classmethod
def load(cls, pathname, project):
print "loading",pathname
if pathname not in cls._modules:
print "premp"
try:
__import__(pathname)
except Exception, ex:
print ex,type(ex)
print "loading",pathname,"done"
return create_desc(sys.modules[pathname], project)
else:
print "loading",pathname,"done"
return cls._modules[pathname]
-------------------------------------------------------------------
The exception __import__ is throwing is an IOError. That somehow
causes the program to exit, not hanging/stall. It does seem as if
exclusion of the problem module is not called before trying to import
it?
~Gerdus
> I have however found the offending code after digging around:
> in ModuleDesc:
> -------------------------------------------------------------------
> @classmethod
> def load(cls, pathname, project):
> print "loading",pathname
> if pathname not in cls._modules:
> print "premp"
> try:
> __import__(pathname)
> except Exception, ex:
> print ex,type(ex)
> print "loading",pathname,"done"
> return create_desc(sys.modules[pathname], project)
> else:
> print "loading",pathname,"done"
> return cls._modules[pathname]
> -------------------------------------------------------------------
>
> The exception __import__ is throwing is an IOError. That somehow
> causes the program to exit, not hanging/stall. It does seem as if
> exclusion of the problem module is not called before trying to import
> it?
>
> ~Gerdus
Great, I'll have a closer look and will come back to you as soon as
possible. Not before wednesday unfortunately, as I won't be here
tomorrow. Thanks for figuring that out, Gerdus.
Hi Gerdus!
Could you please update to the latest trunk (r47) and see, if this
changes anything for you?
Thanks & greetings!
--
Daniel Haus
http://ematia.de
Normal:
<module 'uxGUI.platforms.platformgtk' from 'C:\uxpython\src\uxGUI\platforms\plat
formgtk.pyc'> <class 'uxGUI.platforms.platformgtk.platformWindow'>
One that gives the error:
None <class 'pywintypes.error'>
see output below:
--------------------------------
C:\uxpython\src>setup.py apydia
running apydia
Generating API reference documentation.
running apydia
Generating API reference documentation.
2008-03-06 12:05:11,164 DEBUG generating symbol "apydocs\base.html"
2008-03-06 12:05:11,164 DEBUG generating symbol "apydocs\base.uBase.html"
2008-03-06 12:05:12,676 DEBUG generating symbol "apydocs\base.uxCalculated.html"
2008-03-06 12:05:12,706 DEBUG generating symbol "apydocs\base.uxEvent.html"
2008-03-06 12:05:13,127 DEBUG generating symbol "apydocs\uxGUI.window.html"
2008-03-06 12:05:13,127 DEBUG generating symbol "apydocs\uxGUI.window.syncoset.h
tml"
<string>:1: (ERROR/3) Document or section may not begin with a transition.
<string>:1: (ERROR/3) Document may not end with a transition.
2008-03-06 12:05:13,576 DEBUG generating symbol "apydocs\uxGUI.window.uxWindow.h
tml"
<string>:1: (ERROR/3) Invalid section title or transition marker.
******************************************************************************
*******************************************************************************
<string>:3: (ERROR/3) Invalid section title or transition marker.
*******************************************************************************
*******************************************************************************
<string>:1: (ERROR/3) Document or section may not begin with a transition.
<string>:1: (ERROR/3) Document may not end with a transition.
<string>:1: (ERROR/3) Invalid section title or transition marker.
******************************************************************************
*******************************************************************************
<string>:3: (ERROR/3) Invalid section title or transition marker.
*******************************************************************************
*******************************************************************************
2008-03-06 12:05:15,079 DEBUG copying "c:\uxpython\docs\apydia\apydia\themes\def
ault\css/default.css" to "apydocs\css/default.css"
2008-03-06 12:05:15,089 DEBUG generating resource "apydocs\css/pygments.css"
2008-03-06 12:05:15,220 ERROR Failed to extract comments from <function GetArgv
at 0x0188A6F0>: list index out of range
Traceback (most recent call last):
File "C:\uxpython\src\setup.py", line 65, in <module>
download_url = "http://www.uxpython.com/toolkit",
File "c:\python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "c:\python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "c:\python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "c:\uxpython\docs\apydia\apydia\options.py", line 155, in run
self.execute(main, (), msg=message)
File "c:\python25\lib\distutils\cmd.py", line 358, in execute
util.execute(func, args, msg, dry_run=self.dry_run)
File "c:\python25\lib\distutils\util.py", line 347, in execute
apply(func, args)
File "c:\uxpython\docs\apydia\apydia\options.py", line 154, in main
self.option_parser.run_from_distutils(self)
File "c:\uxpython\docs\apydia\apydia\options.py", line 167, in run_from_distut
ils
self.run(options)
File "c:\uxpython\docs\apydia\apydia\command.py", line 96, in run
project = Project(options)
File "c:\uxpython\docs\apydia\apydia\project.py", line 63, in __init__
desc = ModuleDesc.load(module_name, self)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load
return create_desc(sys.modules[pathname], project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc
return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 228, in __init__
self.parent = ModuleDesc.load(".".join(self.pathname.split(".")[:-1]), proje
ct)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load
return create_desc(sys.modules[pathname], project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc
return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 221, in __init__
for name, desc in self.find_submodules():
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 289, in find_submod
ules
m = ModuleDesc.load(prefix + name, self.project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load
return create_desc(sys.modules[pathname], project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc
return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 221, in __init__
for name, desc in self.find_submodules():
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 289, in find_submod
ules
m = ModuleDesc.load(prefix + name, self.project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load
return create_desc(sys.modules[pathname], project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc
return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 217, in __init__
super(ModuleDesc, self).__init__(module, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 114, in __init__
self._members = self.find_members()
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 261, in find_member
s
desc = create_desc(value, self.project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc
return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 323, in __init__
self.module = ModuleDesc.load(getmodule(class_).__name__, project)
AttributeError: 'NoneType' object has no attribute '__name__'
----------------------------
Sorry for causing all this trouble :-)
Thanks.
---------
Now this looks much better to me, and the stacktrace really helps a
lot. I'll see what I can find from here...
Could you figure the class out on which it chokes? This could be
easily done by putting some print statement into the constructor of
"ClassDesc", like so (descriptors.py, lines 318 and following):
def __init__(self, class_, project):
super(ClassDesc, self).__init__(class_, project)
self.name = getattr(class_, "__name__", "")
if not isinstance(self.name, basestring):
self.name = ""
print self.name
self.module = ModuleDesc.load(getmodule(class_).__name__,
project)
self.parent = self.module
self.pathname = ".".join([self.module.pathname, self.name])
print class_,self.name,getmodule(class_)
i get the following:
<class 'pywintypes.error'> error None
and output for nonfailing class:
<class 'uxGUI.platforms.platformgtk.platformWindow'> platformWindow <module 'uxG
UI.platforms.platformgtk' from 'C:\uxpython\src\uxGUI\platforms\platformgtk.pyc'
>
FYI, pywintypes is a c extension.
~Gerdus
Maybe because it can't find the module it can't exclude it? All the
errors I have gotten with apydia has been with code that I did not
create and would happily exclude if I could.
Most likely, it needs to find out the package's absolute pathname
before comparing it to the 'exclude'-patterns.
We're one step closer, but this won't work too well 'remotely'. I'll
setup a virtual Windows environment and try to reproduce (and debug)
the errors directly. Testing packages that depend on binary, non-
python modules is on my Apydia-todo-list as well as testing it under
Windows, anyway. So that's a great chance for me to get these things
done.
Thank you for your patience, I'll keep you informed about my progress.
Greetings!
Am 06.03.2008 um 21:06 schrieb Gerdus van Zyl:
>