Catherine
unread,Aug 11, 2009, 9:42:15 AM8/11/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlpython
I need advice from somebody who really gets Python packaging and
namespacing. (This is my confession that I do not.)
I can't run unit tests against sqlpyPlus.py right now:
catherine@DellZilla:~/proj/sqlpython/sqlpython$ python sqlpyPlus.py
/usr/bin/gedit
Traceback (most recent call last):
File "sqlpyPlus.py", line 26, in <module>
import sys, os, re, sqlpython, cx_Oracle, pyparsing, re,
completion, datetime, pickle, binascii, subprocess, time, itertools,
hashlib
File "/home/catherine/proj/sqlpython/sqlpython/sqlpython.py", line
12, in <module>
import sqlpyPlus, sqlalchemy, pyparsing
File "/home/catherine/proj/sqlpython/sqlpython/sqlpyPlus.py", line
31, in <module>
from sqlpython import Parser
ImportError: cannot import name Parser
I don't understand why it can't do the import, but I can see why it's
hard to figure out. The package is named sqlpython, it includes a
module sqlpython.py, and that module includes a class `sqlpython`...
and sqlpython.py and sqlpyPlus.py both have imports from each other...
OK, that was probably not a real good move strategically.
Short of some massive refactoring effort (which I do daydream of
taking the time for), is there any advice for untangling this snarl?
Do you think it would be good enough to rename the module and the
class - perhaps to `sqlpython_core.py` and `class Cmdloop`? That, at
least, might make it more apparent where the problem is coming from.
Thanks in advance for your advice,
- Catherine