SM0 She11
Path:
/
/
usr
/
lib64
/
python2.7
Full Path (server): /usr/lib64/python2.7
Create Fil3
Upl04d Fil3
📄 BaseHTTPServer.py
[E]
[D]
[R]
📄 BaseHTTPServer.pyc
[E]
[D]
[R]
📄 BaseHTTPServer.pyo
[E]
[D]
[R]
📄 Bastion.py
[E]
[D]
[R]
📄 Bastion.pyc
[E]
[D]
[R]
📄 Bastion.pyo
[E]
[D]
[R]
📄 CGIHTTPServer.py
[E]
[D]
[R]
📄 CGIHTTPServer.pyc
[E]
[D]
[R]
📄 CGIHTTPServer.pyo
[E]
[D]
[R]
📄 ConfigParser.py
[E]
[D]
[R]
📄 ConfigParser.pyc
[E]
[D]
[R]
📄 ConfigParser.pyo
[E]
[D]
[R]
📄 Cookie.py
[E]
[D]
[R]
📄 Cookie.pyc
[E]
[D]
[R]
📄 Cookie.pyo
[E]
[D]
[R]
📄 DocXMLRPCServer.py
[E]
[D]
[R]
📄 DocXMLRPCServer.pyc
[E]
[D]
[R]
📄 DocXMLRPCServer.pyo
[E]
[D]
[R]
📄 HTMLParser.py
[E]
[D]
[R]
📄 HTMLParser.pyc
[E]
[D]
[R]
📄 HTMLParser.pyo
[E]
[D]
[R]
📄 MimeWriter.py
[E]
[D]
[R]
📄 MimeWriter.pyc
[E]
[D]
[R]
📄 MimeWriter.pyo
[E]
[D]
[R]
📄 Queue.py
[E]
[D]
[R]
📄 Queue.pyc
[E]
[D]
[R]
📄 Queue.pyo
[E]
[D]
[R]
📄 SimpleHTTPServer.py
[E]
[D]
[R]
📄 SimpleHTTPServer.pyc
[E]
[D]
[R]
📄 SimpleHTTPServer.pyo
[E]
[D]
[R]
📄 SimpleXMLRPCServer.py
[E]
[D]
[R]
📄 SimpleXMLRPCServer.pyc
[E]
[D]
[R]
📄 SimpleXMLRPCServer.pyo
[E]
[D]
[R]
📄 SocketServer.py
[E]
[D]
[R]
📄 SocketServer.pyc
[E]
[D]
[R]
📄 SocketServer.pyo
[E]
[D]
[R]
📄 StringIO.py
[E]
[D]
[R]
📄 StringIO.pyc
[E]
[D]
[R]
📄 StringIO.pyo
[E]
[D]
[R]
📄 UserDict.py
[E]
[D]
[R]
📄 UserDict.pyc
[E]
[D]
[R]
📄 UserDict.pyo
[E]
[D]
[R]
📄 UserList.py
[E]
[D]
[R]
📄 UserList.pyc
[E]
[D]
[R]
📄 UserList.pyo
[E]
[D]
[R]
📄 UserString.py
[E]
[D]
[R]
📄 UserString.pyc
[E]
[D]
[R]
📄 UserString.pyo
[E]
[D]
[R]
📄 _LWPCookieJar.py
[E]
[D]
[R]
📄 _LWPCookieJar.pyc
[E]
[D]
[R]
📄 _LWPCookieJar.pyo
[E]
[D]
[R]
📄 _MozillaCookieJar.py
[E]
[D]
[R]
📄 _MozillaCookieJar.pyc
[E]
[D]
[R]
📄 _MozillaCookieJar.pyo
[E]
[D]
[R]
📄 __future__.py
[E]
[D]
[R]
📄 __future__.pyc
[E]
[D]
[R]
📄 __future__.pyo
[E]
[D]
[R]
📄 __phello__.foo.py
[E]
[D]
[R]
📄 __phello__.foo.pyc
[E]
[D]
[R]
📄 __phello__.foo.pyo
[E]
[D]
[R]
📄 _abcoll.py
[E]
[D]
[R]
📄 _abcoll.pyc
[E]
[D]
[R]
📄 _abcoll.pyo
[E]
[D]
[R]
📄 _osx_support.py
[E]
[D]
[R]
📄 _osx_support.pyc
[E]
[D]
[R]
📄 _osx_support.pyo
[E]
[D]
[R]
📄 _pyio.py
[E]
[D]
[R]
📄 _pyio.pyc
[E]
[D]
[R]
📄 _pyio.pyo
[E]
[D]
[R]
📄 _strptime.py
[E]
[D]
[R]
📄 _strptime.pyc
[E]
[D]
[R]
📄 _strptime.pyo
[E]
[D]
[R]
📄 _sysconfigdata.py
[E]
[D]
[R]
📄 _sysconfigdata.pyc
[E]
[D]
[R]
📄 _sysconfigdata.pyo
[E]
[D]
[R]
📄 _threading_local.py
[E]
[D]
[R]
📄 _threading_local.pyc
[E]
[D]
[R]
📄 _threading_local.pyo
[E]
[D]
[R]
📄 _weakrefset.py
[E]
[D]
[R]
📄 _weakrefset.pyc
[E]
[D]
[R]
📄 _weakrefset.pyo
[E]
[D]
[R]
📄 abc.py
[E]
[D]
[R]
📄 abc.pyc
[E]
[D]
[R]
📄 abc.pyo
[E]
[D]
[R]
📄 aifc.py
[E]
[D]
[R]
📄 aifc.pyc
[E]
[D]
[R]
📄 aifc.pyo
[E]
[D]
[R]
📄 antigravity.py
[E]
[D]
[R]
📄 antigravity.pyc
[E]
[D]
[R]
📄 antigravity.pyo
[E]
[D]
[R]
📄 anydbm.py
[E]
[D]
[R]
📄 anydbm.pyc
[E]
[D]
[R]
📄 anydbm.pyo
[E]
[D]
[R]
📄 argparse.py
[E]
[D]
[R]
📄 argparse.pyc
[E]
[D]
[R]
📄 argparse.pyo
[E]
[D]
[R]
📄 ast.py
[E]
[D]
[R]
📄 ast.pyc
[E]
[D]
[R]
📄 ast.pyo
[E]
[D]
[R]
📄 asynchat.py
[E]
[D]
[R]
📄 asynchat.pyc
[E]
[D]
[R]
📄 asynchat.pyo
[E]
[D]
[R]
📄 asyncore.py
[E]
[D]
[R]
📄 asyncore.pyc
[E]
[D]
[R]
📄 asyncore.pyo
[E]
[D]
[R]
📄 atexit.py
[E]
[D]
[R]
📄 atexit.pyc
[E]
[D]
[R]
📄 atexit.pyo
[E]
[D]
[R]
📄 audiodev.py
[E]
[D]
[R]
📄 audiodev.pyc
[E]
[D]
[R]
📄 audiodev.pyo
[E]
[D]
[R]
📄 base64.py
[E]
[D]
[R]
📄 base64.pyc
[E]
[D]
[R]
📄 base64.pyo
[E]
[D]
[R]
📄 bdb.py
[E]
[D]
[R]
📄 bdb.pyc
[E]
[D]
[R]
📄 bdb.pyo
[E]
[D]
[R]
📄 binhex.py
[E]
[D]
[R]
📄 binhex.pyc
[E]
[D]
[R]
📄 binhex.pyo
[E]
[D]
[R]
📄 bisect.py
[E]
[D]
[R]
📄 bisect.pyc
[E]
[D]
[R]
📄 bisect.pyo
[E]
[D]
[R]
📁 bsddb
Open
[D]
[R]
📄 cProfile.py
[E]
[D]
[R]
📄 cProfile.pyc
[E]
[D]
[R]
📄 cProfile.pyo
[E]
[D]
[R]
📄 calendar.py
[E]
[D]
[R]
📄 calendar.pyc
[E]
[D]
[R]
📄 calendar.pyo
[E]
[D]
[R]
📄 cgi.py
[E]
[D]
[R]
📄 cgi.pyc
[E]
[D]
[R]
📄 cgi.pyo
[E]
[D]
[R]
📄 cgitb.py
[E]
[D]
[R]
📄 cgitb.pyc
[E]
[D]
[R]
📄 cgitb.pyo
[E]
[D]
[R]
📄 chunk.py
[E]
[D]
[R]
📄 chunk.pyc
[E]
[D]
[R]
📄 chunk.pyo
[E]
[D]
[R]
📄 cmd.py
[E]
[D]
[R]
📄 cmd.pyc
[E]
[D]
[R]
📄 cmd.pyo
[E]
[D]
[R]
📄 code.py
[E]
[D]
[R]
📄 code.pyc
[E]
[D]
[R]
📄 code.pyo
[E]
[D]
[R]
📄 codecs.py
[E]
[D]
[R]
📄 codecs.pyc
[E]
[D]
[R]
📄 codecs.pyo
[E]
[D]
[R]
📄 codeop.py
[E]
[D]
[R]
📄 codeop.pyc
[E]
[D]
[R]
📄 codeop.pyo
[E]
[D]
[R]
📄 collections.py
[E]
[D]
[R]
📄 collections.pyc
[E]
[D]
[R]
📄 collections.pyo
[E]
[D]
[R]
📄 colorsys.py
[E]
[D]
[R]
📄 colorsys.pyc
[E]
[D]
[R]
📄 colorsys.pyo
[E]
[D]
[R]
📄 commands.py
[E]
[D]
[R]
📄 commands.pyc
[E]
[D]
[R]
📄 commands.pyo
[E]
[D]
[R]
📄 compileall.py
[E]
[D]
[R]
📄 compileall.pyc
[E]
[D]
[R]
📄 compileall.pyo
[E]
[D]
[R]
📁 compiler
Open
[D]
[R]
📁 config
Open
[D]
[R]
📄 contextlib.py
[E]
[D]
[R]
📄 contextlib.pyc
[E]
[D]
[R]
📄 contextlib.pyo
[E]
[D]
[R]
📄 cookielib.py
[E]
[D]
[R]
📄 cookielib.pyc
[E]
[D]
[R]
📄 cookielib.pyo
[E]
[D]
[R]
📄 copy.py
[E]
[D]
[R]
📄 copy.pyc
[E]
[D]
[R]
📄 copy.pyo
[E]
[D]
[R]
📄 copy_reg.py
[E]
[D]
[R]
📄 copy_reg.pyc
[E]
[D]
[R]
📄 copy_reg.pyo
[E]
[D]
[R]
📄 crypt.py
[E]
[D]
[R]
📄 crypt.pyc
[E]
[D]
[R]
📄 crypt.pyo
[E]
[D]
[R]
📄 csv.py
[E]
[D]
[R]
📄 csv.pyc
[E]
[D]
[R]
📄 csv.pyo
[E]
[D]
[R]
📁 ctypes
Open
[D]
[R]
📁 curses
Open
[D]
[R]
📄 dbhash.py
[E]
[D]
[R]
📄 dbhash.pyc
[E]
[D]
[R]
📄 dbhash.pyo
[E]
[D]
[R]
📄 decimal.py
[E]
[D]
[R]
📄 decimal.pyc
[E]
[D]
[R]
📄 decimal.pyo
[E]
[D]
[R]
📄 difflib.py
[E]
[D]
[R]
📄 difflib.pyc
[E]
[D]
[R]
📄 difflib.pyo
[E]
[D]
[R]
📄 dircache.py
[E]
[D]
[R]
📄 dircache.pyc
[E]
[D]
[R]
📄 dircache.pyo
[E]
[D]
[R]
📄 dis.py
[E]
[D]
[R]
📄 dis.pyc
[E]
[D]
[R]
📄 dis.pyo
[E]
[D]
[R]
📁 distutils
Open
[D]
[R]
📄 doctest.py
[E]
[D]
[R]
📄 doctest.pyc
[E]
[D]
[R]
📄 doctest.pyo
[E]
[D]
[R]
📄 dumbdbm.py
[E]
[D]
[R]
📄 dumbdbm.pyc
[E]
[D]
[R]
📄 dumbdbm.pyo
[E]
[D]
[R]
📄 dummy_thread.py
[E]
[D]
[R]
📄 dummy_thread.pyc
[E]
[D]
[R]
📄 dummy_thread.pyo
[E]
[D]
[R]
📄 dummy_threading.py
[E]
[D]
[R]
📄 dummy_threading.pyc
[E]
[D]
[R]
📄 dummy_threading.pyo
[E]
[D]
[R]
📁 email
Open
[D]
[R]
📁 encodings
Open
[D]
[R]
📄 filecmp.py
[E]
[D]
[R]
📄 filecmp.pyc
[E]
[D]
[R]
📄 filecmp.pyo
[E]
[D]
[R]
📄 fileinput.py
[E]
[D]
[R]
📄 fileinput.pyc
[E]
[D]
[R]
📄 fileinput.pyo
[E]
[D]
[R]
📄 fnmatch.py
[E]
[D]
[R]
📄 fnmatch.pyc
[E]
[D]
[R]
📄 fnmatch.pyo
[E]
[D]
[R]
📄 formatter.py
[E]
[D]
[R]
📄 formatter.pyc
[E]
[D]
[R]
📄 formatter.pyo
[E]
[D]
[R]
📄 fpformat.py
[E]
[D]
[R]
📄 fpformat.pyc
[E]
[D]
[R]
📄 fpformat.pyo
[E]
[D]
[R]
📄 fractions.py
[E]
[D]
[R]
📄 fractions.pyc
[E]
[D]
[R]
📄 fractions.pyo
[E]
[D]
[R]
📄 ftplib.py
[E]
[D]
[R]
📄 ftplib.pyc
[E]
[D]
[R]
📄 ftplib.pyo
[E]
[D]
[R]
📄 functools.py
[E]
[D]
[R]
📄 functools.pyc
[E]
[D]
[R]
📄 functools.pyo
[E]
[D]
[R]
📄 genericpath.py
[E]
[D]
[R]
📄 genericpath.pyc
[E]
[D]
[R]
📄 genericpath.pyo
[E]
[D]
[R]
📄 getopt.py
[E]
[D]
[R]
📄 getopt.pyc
[E]
[D]
[R]
📄 getopt.pyo
[E]
[D]
[R]
📄 getpass.py
[E]
[D]
[R]
📄 getpass.pyc
[E]
[D]
[R]
📄 getpass.pyo
[E]
[D]
[R]
📄 gettext.py
[E]
[D]
[R]
📄 gettext.pyc
[E]
[D]
[R]
📄 gettext.pyo
[E]
[D]
[R]
📄 glob.py
[E]
[D]
[R]
📄 glob.pyc
[E]
[D]
[R]
📄 glob.pyo
[E]
[D]
[R]
📄 gzip.py
[E]
[D]
[R]
📄 gzip.pyc
[E]
[D]
[R]
📄 gzip.pyo
[E]
[D]
[R]
📄 hashlib.py
[E]
[D]
[R]
📄 hashlib.pyc
[E]
[D]
[R]
📄 hashlib.pyo
[E]
[D]
[R]
📄 heapq.py
[E]
[D]
[R]
📄 heapq.pyc
[E]
[D]
[R]
📄 heapq.pyo
[E]
[D]
[R]
📄 hmac.py
[E]
[D]
[R]
📄 hmac.pyc
[E]
[D]
[R]
📄 hmac.pyo
[E]
[D]
[R]
📁 hotshot
Open
[D]
[R]
📄 htmlentitydefs.py
[E]
[D]
[R]
📄 htmlentitydefs.pyc
[E]
[D]
[R]
📄 htmlentitydefs.pyo
[E]
[D]
[R]
📄 htmllib.py
[E]
[D]
[R]
📄 htmllib.pyc
[E]
[D]
[R]
📄 htmllib.pyo
[E]
[D]
[R]
📄 httplib.py
[E]
[D]
[R]
📄 httplib.pyc
[E]
[D]
[R]
📄 httplib.pyo
[E]
[D]
[R]
📁 idlelib
Open
[D]
[R]
📄 ihooks.py
[E]
[D]
[R]
📄 ihooks.pyc
[E]
[D]
[R]
📄 ihooks.pyo
[E]
[D]
[R]
📄 imaplib.py
[E]
[D]
[R]
📄 imaplib.pyc
[E]
[D]
[R]
📄 imaplib.pyo
[E]
[D]
[R]
📄 imghdr.py
[E]
[D]
[R]
📄 imghdr.pyc
[E]
[D]
[R]
📄 imghdr.pyo
[E]
[D]
[R]
📁 importlib
Open
[D]
[R]
📄 imputil.py
[E]
[D]
[R]
📄 imputil.pyc
[E]
[D]
[R]
📄 imputil.pyo
[E]
[D]
[R]
📄 inspect.py
[E]
[D]
[R]
📄 inspect.pyc
[E]
[D]
[R]
📄 inspect.pyo
[E]
[D]
[R]
📄 io.py
[E]
[D]
[R]
📄 io.pyc
[E]
[D]
[R]
📄 io.pyo
[E]
[D]
[R]
📁 json
Open
[D]
[R]
📄 keyword.py
[E]
[D]
[R]
📄 keyword.pyc
[E]
[D]
[R]
📄 keyword.pyo
[E]
[D]
[R]
📁 lib-dynload
Open
[D]
[R]
📁 lib2to3
Open
[D]
[R]
📄 linecache.py
[E]
[D]
[R]
📄 linecache.pyc
[E]
[D]
[R]
📄 linecache.pyo
[E]
[D]
[R]
📄 locale.py
[E]
[D]
[R]
📄 locale.pyc
[E]
[D]
[R]
📄 locale.pyo
[E]
[D]
[R]
📁 logging
Open
[D]
[R]
📄 macpath.py
[E]
[D]
[R]
📄 macpath.pyc
[E]
[D]
[R]
📄 macpath.pyo
[E]
[D]
[R]
📄 macurl2path.py
[E]
[D]
[R]
📄 macurl2path.pyc
[E]
[D]
[R]
📄 macurl2path.pyo
[E]
[D]
[R]
📄 mailbox.py
[E]
[D]
[R]
📄 mailbox.pyc
[E]
[D]
[R]
📄 mailbox.pyo
[E]
[D]
[R]
📄 mailcap.py
[E]
[D]
[R]
📄 mailcap.pyc
[E]
[D]
[R]
📄 mailcap.pyo
[E]
[D]
[R]
📄 markupbase.py
[E]
[D]
[R]
📄 markupbase.pyc
[E]
[D]
[R]
📄 markupbase.pyo
[E]
[D]
[R]
📄 md5.py
[E]
[D]
[R]
📄 md5.pyc
[E]
[D]
[R]
📄 md5.pyo
[E]
[D]
[R]
📄 mhlib.py
[E]
[D]
[R]
📄 mhlib.pyc
[E]
[D]
[R]
📄 mhlib.pyo
[E]
[D]
[R]
📄 mimetools.py
[E]
[D]
[R]
📄 mimetools.pyc
[E]
[D]
[R]
📄 mimetools.pyo
[E]
[D]
[R]
📄 mimetypes.py
[E]
[D]
[R]
📄 mimetypes.pyc
[E]
[D]
[R]
📄 mimetypes.pyo
[E]
[D]
[R]
📄 mimify.py
[E]
[D]
[R]
📄 mimify.pyc
[E]
[D]
[R]
📄 mimify.pyo
[E]
[D]
[R]
📄 modulefinder.py
[E]
[D]
[R]
📄 modulefinder.pyc
[E]
[D]
[R]
📄 modulefinder.pyo
[E]
[D]
[R]
📄 multifile.py
[E]
[D]
[R]
📄 multifile.pyc
[E]
[D]
[R]
📄 multifile.pyo
[E]
[D]
[R]
📁 multiprocessing
Open
[D]
[R]
📄 mutex.py
[E]
[D]
[R]
📄 mutex.pyc
[E]
[D]
[R]
📄 mutex.pyo
[E]
[D]
[R]
📄 netrc.py
[E]
[D]
[R]
📄 netrc.pyc
[E]
[D]
[R]
📄 netrc.pyo
[E]
[D]
[R]
📄 new.py
[E]
[D]
[R]
📄 new.pyc
[E]
[D]
[R]
📄 new.pyo
[E]
[D]
[R]
📄 nntplib.py
[E]
[D]
[R]
📄 nntplib.pyc
[E]
[D]
[R]
📄 nntplib.pyo
[E]
[D]
[R]
📄 ntpath.py
[E]
[D]
[R]
📄 ntpath.pyc
[E]
[D]
[R]
📄 ntpath.pyo
[E]
[D]
[R]
📄 nturl2path.py
[E]
[D]
[R]
📄 nturl2path.pyc
[E]
[D]
[R]
📄 nturl2path.pyo
[E]
[D]
[R]
📄 numbers.py
[E]
[D]
[R]
📄 numbers.pyc
[E]
[D]
[R]
📄 numbers.pyo
[E]
[D]
[R]
📄 opcode.py
[E]
[D]
[R]
📄 opcode.pyc
[E]
[D]
[R]
📄 opcode.pyo
[E]
[D]
[R]
📄 optparse.py
[E]
[D]
[R]
📄 optparse.pyc
[E]
[D]
[R]
📄 optparse.pyo
[E]
[D]
[R]
📄 os.py
[E]
[D]
[R]
📄 os.pyc
[E]
[D]
[R]
📄 os.pyo
[E]
[D]
[R]
📄 os2emxpath.py
[E]
[D]
[R]
📄 os2emxpath.pyc
[E]
[D]
[R]
📄 os2emxpath.pyo
[E]
[D]
[R]
📄 pdb.doc
[E]
[D]
[R]
📄 pdb.py
[E]
[D]
[R]
📄 pdb.pyc
[E]
[D]
[R]
📄 pdb.pyo
[E]
[D]
[R]
📄 pickle.py
[E]
[D]
[R]
📄 pickle.pyc
[E]
[D]
[R]
📄 pickle.pyo
[E]
[D]
[R]
📄 pickletools.py
[E]
[D]
[R]
📄 pickletools.pyc
[E]
[D]
[R]
📄 pickletools.pyo
[E]
[D]
[R]
📄 pipes.py
[E]
[D]
[R]
📄 pipes.pyc
[E]
[D]
[R]
📄 pipes.pyo
[E]
[D]
[R]
📄 pkgutil.py
[E]
[D]
[R]
📄 pkgutil.pyc
[E]
[D]
[R]
📄 pkgutil.pyo
[E]
[D]
[R]
📁 plat-linux2
Open
[D]
[R]
📄 platform.py
[E]
[D]
[R]
📄 platform.pyc
[E]
[D]
[R]
📄 platform.pyo
[E]
[D]
[R]
📄 plistlib.py
[E]
[D]
[R]
📄 plistlib.pyc
[E]
[D]
[R]
📄 plistlib.pyo
[E]
[D]
[R]
📄 popen2.py
[E]
[D]
[R]
📄 popen2.pyc
[E]
[D]
[R]
📄 popen2.pyo
[E]
[D]
[R]
📄 poplib.py
[E]
[D]
[R]
📄 poplib.pyc
[E]
[D]
[R]
📄 poplib.pyo
[E]
[D]
[R]
📄 posixfile.py
[E]
[D]
[R]
📄 posixfile.pyc
[E]
[D]
[R]
📄 posixfile.pyo
[E]
[D]
[R]
📄 posixpath.py
[E]
[D]
[R]
📄 posixpath.pyc
[E]
[D]
[R]
📄 posixpath.pyo
[E]
[D]
[R]
📄 pprint.py
[E]
[D]
[R]
📄 pprint.pyc
[E]
[D]
[R]
📄 pprint.pyo
[E]
[D]
[R]
📄 profile.py
[E]
[D]
[R]
📄 profile.pyc
[E]
[D]
[R]
📄 profile.pyo
[E]
[D]
[R]
📄 pstats.py
[E]
[D]
[R]
📄 pstats.pyc
[E]
[D]
[R]
📄 pstats.pyo
[E]
[D]
[R]
📄 pty.py
[E]
[D]
[R]
📄 pty.pyc
[E]
[D]
[R]
📄 pty.pyo
[E]
[D]
[R]
📄 py_compile.py
[E]
[D]
[R]
📄 py_compile.pyc
[E]
[D]
[R]
📄 py_compile.pyo
[E]
[D]
[R]
📄 pyclbr.py
[E]
[D]
[R]
📄 pyclbr.pyc
[E]
[D]
[R]
📄 pyclbr.pyo
[E]
[D]
[R]
📄 pydoc.py
[E]
[D]
[R]
📄 pydoc.pyc
[E]
[D]
[R]
📄 pydoc.pyo
[E]
[D]
[R]
📁 pydoc_data
Open
[D]
[R]
📄 quopri.py
[E]
[D]
[R]
📄 quopri.pyc
[E]
[D]
[R]
📄 quopri.pyo
[E]
[D]
[R]
📄 random.py
[E]
[D]
[R]
📄 random.pyc
[E]
[D]
[R]
📄 random.pyo
[E]
[D]
[R]
📄 re.py
[E]
[D]
[R]
📄 re.pyc
[E]
[D]
[R]
📄 re.pyo
[E]
[D]
[R]
📄 repr.py
[E]
[D]
[R]
📄 repr.pyc
[E]
[D]
[R]
📄 repr.pyo
[E]
[D]
[R]
📄 rexec.py
[E]
[D]
[R]
📄 rexec.pyc
[E]
[D]
[R]
📄 rexec.pyo
[E]
[D]
[R]
📄 rfc822.py
[E]
[D]
[R]
📄 rfc822.pyc
[E]
[D]
[R]
📄 rfc822.pyo
[E]
[D]
[R]
📄 rlcompleter.py
[E]
[D]
[R]
📄 rlcompleter.pyc
[E]
[D]
[R]
📄 rlcompleter.pyo
[E]
[D]
[R]
📄 robotparser.py
[E]
[D]
[R]
📄 robotparser.pyc
[E]
[D]
[R]
📄 robotparser.pyo
[E]
[D]
[R]
📄 runpy.py
[E]
[D]
[R]
📄 runpy.pyc
[E]
[D]
[R]
📄 runpy.pyo
[E]
[D]
[R]
📄 sched.py
[E]
[D]
[R]
📄 sched.pyc
[E]
[D]
[R]
📄 sched.pyo
[E]
[D]
[R]
📄 sets.py
[E]
[D]
[R]
📄 sets.pyc
[E]
[D]
[R]
📄 sets.pyo
[E]
[D]
[R]
📄 sgmllib.py
[E]
[D]
[R]
📄 sgmllib.pyc
[E]
[D]
[R]
📄 sgmllib.pyo
[E]
[D]
[R]
📄 sha.py
[E]
[D]
[R]
📄 sha.pyc
[E]
[D]
[R]
📄 sha.pyo
[E]
[D]
[R]
📄 shelve.py
[E]
[D]
[R]
📄 shelve.pyc
[E]
[D]
[R]
📄 shelve.pyo
[E]
[D]
[R]
📄 shlex.py
[E]
[D]
[R]
📄 shlex.pyc
[E]
[D]
[R]
📄 shlex.pyo
[E]
[D]
[R]
📄 shutil.py
[E]
[D]
[R]
📄 shutil.pyc
[E]
[D]
[R]
📄 shutil.pyo
[E]
[D]
[R]
📁 site-packages
Open
[D]
[R]
📄 site.py
[E]
[D]
[R]
📄 site.pyc
[E]
[D]
[R]
📄 site.pyo
[E]
[D]
[R]
📄 smtpd.py
[E]
[D]
[R]
📄 smtpd.pyc
[E]
[D]
[R]
📄 smtpd.pyo
[E]
[D]
[R]
📄 smtplib.py
[E]
[D]
[R]
📄 smtplib.pyc
[E]
[D]
[R]
📄 smtplib.pyo
[E]
[D]
[R]
📄 sndhdr.py
[E]
[D]
[R]
📄 sndhdr.pyc
[E]
[D]
[R]
📄 sndhdr.pyo
[E]
[D]
[R]
📄 socket.py
[E]
[D]
[R]
📄 socket.pyc
[E]
[D]
[R]
📄 socket.pyo
[E]
[D]
[R]
📁 sqlite3
Open
[D]
[R]
📄 sre.py
[E]
[D]
[R]
📄 sre.pyc
[E]
[D]
[R]
📄 sre.pyo
[E]
[D]
[R]
📄 sre_compile.py
[E]
[D]
[R]
📄 sre_compile.pyc
[E]
[D]
[R]
📄 sre_compile.pyo
[E]
[D]
[R]
📄 sre_constants.py
[E]
[D]
[R]
📄 sre_constants.pyc
[E]
[D]
[R]
📄 sre_constants.pyo
[E]
[D]
[R]
📄 sre_parse.py
[E]
[D]
[R]
📄 sre_parse.pyc
[E]
[D]
[R]
📄 sre_parse.pyo
[E]
[D]
[R]
📄 ssl.py
[E]
[D]
[R]
📄 ssl.pyc
[E]
[D]
[R]
📄 ssl.pyo
[E]
[D]
[R]
📄 stat.py
[E]
[D]
[R]
📄 stat.pyc
[E]
[D]
[R]
📄 stat.pyo
[E]
[D]
[R]
📄 statvfs.py
[E]
[D]
[R]
📄 statvfs.pyc
[E]
[D]
[R]
📄 statvfs.pyo
[E]
[D]
[R]
📄 string.py
[E]
[D]
[R]
📄 string.pyc
[E]
[D]
[R]
📄 string.pyo
[E]
[D]
[R]
📄 stringold.py
[E]
[D]
[R]
📄 stringold.pyc
[E]
[D]
[R]
📄 stringold.pyo
[E]
[D]
[R]
📄 stringprep.py
[E]
[D]
[R]
📄 stringprep.pyc
[E]
[D]
[R]
📄 stringprep.pyo
[E]
[D]
[R]
📄 struct.py
[E]
[D]
[R]
📄 struct.pyc
[E]
[D]
[R]
📄 struct.pyo
[E]
[D]
[R]
📄 subprocess.py
[E]
[D]
[R]
📄 subprocess.pyc
[E]
[D]
[R]
📄 subprocess.pyo
[E]
[D]
[R]
📄 sunau.py
[E]
[D]
[R]
📄 sunau.pyc
[E]
[D]
[R]
📄 sunau.pyo
[E]
[D]
[R]
📄 sunaudio.py
[E]
[D]
[R]
📄 sunaudio.pyc
[E]
[D]
[R]
📄 sunaudio.pyo
[E]
[D]
[R]
📄 symbol.py
[E]
[D]
[R]
📄 symbol.pyc
[E]
[D]
[R]
📄 symbol.pyo
[E]
[D]
[R]
📄 symtable.py
[E]
[D]
[R]
📄 symtable.pyc
[E]
[D]
[R]
📄 symtable.pyo
[E]
[D]
[R]
📄 sysconfig.py
[E]
[D]
[R]
📄 sysconfig.pyc
[E]
[D]
[R]
📄 sysconfig.pyo
[E]
[D]
[R]
📄 tabnanny.py
[E]
[D]
[R]
📄 tabnanny.pyc
[E]
[D]
[R]
📄 tabnanny.pyo
[E]
[D]
[R]
📄 tarfile.py
[E]
[D]
[R]
📄 tarfile.pyc
[E]
[D]
[R]
📄 tarfile.pyo
[E]
[D]
[R]
📄 telnetlib.py
[E]
[D]
[R]
📄 telnetlib.pyc
[E]
[D]
[R]
📄 telnetlib.pyo
[E]
[D]
[R]
📄 tempfile.py
[E]
[D]
[R]
📄 tempfile.pyc
[E]
[D]
[R]
📄 tempfile.pyo
[E]
[D]
[R]
📁 test
Open
[D]
[R]
📄 textwrap.py
[E]
[D]
[R]
📄 textwrap.pyc
[E]
[D]
[R]
📄 textwrap.pyo
[E]
[D]
[R]
📄 this.py
[E]
[D]
[R]
📄 this.pyc
[E]
[D]
[R]
📄 this.pyo
[E]
[D]
[R]
📄 threading.py
[E]
[D]
[R]
📄 threading.pyc
[E]
[D]
[R]
📄 threading.pyo
[E]
[D]
[R]
📄 timeit.py
[E]
[D]
[R]
📄 timeit.pyc
[E]
[D]
[R]
📄 timeit.pyo
[E]
[D]
[R]
📄 toaiff.py
[E]
[D]
[R]
📄 toaiff.pyc
[E]
[D]
[R]
📄 toaiff.pyo
[E]
[D]
[R]
📄 token.py
[E]
[D]
[R]
📄 token.pyc
[E]
[D]
[R]
📄 token.pyo
[E]
[D]
[R]
📄 tokenize.py
[E]
[D]
[R]
📄 tokenize.pyc
[E]
[D]
[R]
📄 tokenize.pyo
[E]
[D]
[R]
📄 trace.py
[E]
[D]
[R]
📄 trace.pyc
[E]
[D]
[R]
📄 trace.pyo
[E]
[D]
[R]
📄 traceback.py
[E]
[D]
[R]
📄 traceback.pyc
[E]
[D]
[R]
📄 traceback.pyo
[E]
[D]
[R]
📄 tty.py
[E]
[D]
[R]
📄 tty.pyc
[E]
[D]
[R]
📄 tty.pyo
[E]
[D]
[R]
📄 types.py
[E]
[D]
[R]
📄 types.pyc
[E]
[D]
[R]
📄 types.pyo
[E]
[D]
[R]
📁 unittest
Open
[D]
[R]
📄 urllib.py
[E]
[D]
[R]
📄 urllib.pyc
[E]
[D]
[R]
📄 urllib.pyo
[E]
[D]
[R]
📄 urllib2.py
[E]
[D]
[R]
📄 urllib2.pyc
[E]
[D]
[R]
📄 urllib2.pyo
[E]
[D]
[R]
📄 urlparse.py
[E]
[D]
[R]
📄 urlparse.pyc
[E]
[D]
[R]
📄 urlparse.pyo
[E]
[D]
[R]
📄 user.py
[E]
[D]
[R]
📄 user.pyc
[E]
[D]
[R]
📄 user.pyo
[E]
[D]
[R]
📄 uu.py
[E]
[D]
[R]
📄 uu.pyc
[E]
[D]
[R]
📄 uu.pyo
[E]
[D]
[R]
📄 uuid.py
[E]
[D]
[R]
📄 uuid.pyc
[E]
[D]
[R]
📄 uuid.pyo
[E]
[D]
[R]
📄 warnings.py
[E]
[D]
[R]
📄 warnings.pyc
[E]
[D]
[R]
📄 warnings.pyo
[E]
[D]
[R]
📄 wave.py
[E]
[D]
[R]
📄 wave.pyc
[E]
[D]
[R]
📄 wave.pyo
[E]
[D]
[R]
📄 weakref.py
[E]
[D]
[R]
📄 weakref.pyc
[E]
[D]
[R]
📄 weakref.pyo
[E]
[D]
[R]
📄 webbrowser.py
[E]
[D]
[R]
📄 webbrowser.pyc
[E]
[D]
[R]
📄 webbrowser.pyo
[E]
[D]
[R]
📄 whichdb.py
[E]
[D]
[R]
📄 whichdb.pyc
[E]
[D]
[R]
📄 whichdb.pyo
[E]
[D]
[R]
📁 wsgiref
Open
[D]
[R]
📄 wsgiref.egg-info
[E]
[D]
[R]
📄 xdrlib.py
[E]
[D]
[R]
📄 xdrlib.pyc
[E]
[D]
[R]
📄 xdrlib.pyo
[E]
[D]
[R]
📁 xml
Open
[D]
[R]
📄 xmllib.py
[E]
[D]
[R]
📄 xmllib.pyc
[E]
[D]
[R]
📄 xmllib.pyo
[E]
[D]
[R]
📄 xmlrpclib.py
[E]
[D]
[R]
📄 xmlrpclib.pyc
[E]
[D]
[R]
📄 xmlrpclib.pyo
[E]
[D]
[R]
📄 zipfile.py
[E]
[D]
[R]
📄 zipfile.pyc
[E]
[D]
[R]
📄 zipfile.pyo
[E]
[D]
[R]
Editing: modulefinder.py
"""Find modules used by a script, using introspection.""" # This module should be kept compatible with Python 2.2, see PEP 291. from __future__ import generators import dis import imp import marshal import os import sys import types import struct if hasattr(sys.__stdout__, "newlines"): READ_MODE = "U" # universal line endings else: # remain compatible with Python < 2.3 READ_MODE = "r" LOAD_CONST = chr(dis.opname.index('LOAD_CONST')) IMPORT_NAME = chr(dis.opname.index('IMPORT_NAME')) STORE_NAME = chr(dis.opname.index('STORE_NAME')) STORE_GLOBAL = chr(dis.opname.index('STORE_GLOBAL')) STORE_OPS = [STORE_NAME, STORE_GLOBAL] HAVE_ARGUMENT = chr(dis.HAVE_ARGUMENT) # Modulefinder does a good job at simulating Python's, but it can not # handle __path__ modifications packages make at runtime. Therefore there # is a mechanism whereby you can register extra paths in this map for a # package, and it will be honored. # Note this is a mapping is lists of paths. packagePathMap = {} # A Public interface def AddPackagePath(packagename, path): paths = packagePathMap.get(packagename, []) paths.append(path) packagePathMap[packagename] = paths replacePackageMap = {} # This ReplacePackage mechanism allows modulefinder to work around the # way the _xmlplus package injects itself under the name "xml" into # sys.modules at runtime by calling ReplacePackage("_xmlplus", "xml") # before running ModuleFinder. def ReplacePackage(oldname, newname): replacePackageMap[oldname] = newname class Module: def __init__(self, name, file=None, path=None): self.__name__ = name self.__file__ = file self.__path__ = path self.__code__ = None # The set of global names that are assigned to in the module. # This includes those names imported through starimports of # Python modules. self.globalnames = {} # The set of starimports this module did that could not be # resolved, ie. a starimport from a non-Python module. self.starimports = {} def __repr__(self): s = "Module(%r" % (self.__name__,) if self.__file__ is not None: s = s + ", %r" % (self.__file__,) if self.__path__ is not None: s = s + ", %r" % (self.__path__,) s = s + ")" return s class ModuleFinder: def __init__(self, path=None, debug=0, excludes=[], replace_paths=[]): if path is None: path = sys.path self.path = path self.modules = {} self.badmodules = {} self.debug = debug self.indent = 0 self.excludes = excludes self.replace_paths = replace_paths self.processed_paths = [] # Used in debugging only def msg(self, level, str, *args): if level <= self.debug: for i in range(self.indent): print " ", print str, for arg in args: print repr(arg), print def msgin(self, *args): level = args[0] if level <= self.debug: self.indent = self.indent + 1 self.msg(*args) def msgout(self, *args): level = args[0] if level <= self.debug: self.indent = self.indent - 1 self.msg(*args) def run_script(self, pathname): self.msg(2, "run_script", pathname) fp = open(pathname, READ_MODE) stuff = ("", "r", imp.PY_SOURCE) self.load_module('__main__', fp, pathname, stuff) def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) fp = open(pathname, READ_MODE) stuff = (ext, "r", imp.PY_SOURCE) self.load_module(name, fp, pathname, stuff) def import_hook(self, name, caller=None, fromlist=None, level=-1): self.msg(3, "import_hook", name, caller, fromlist, level) parent = self.determine_parent(caller, level=level) q, tail = self.find_head_package(parent, name) m = self.load_tail(q, tail) if not fromlist: return q if m.__path__: self.ensure_fromlist(m, fromlist) return None def determine_parent(self, caller, level=-1): self.msgin(4, "determine_parent", caller, level) if not caller or level == 0: self.msgout(4, "determine_parent -> None") return None pname = caller.__name__ if level >= 1: # relative import if caller.__path__: level -= 1 if level == 0: parent = self.modules[pname] assert parent is caller self.msgout(4, "determine_parent ->", parent) return parent if pname.count(".") < level: raise ImportError, "relative importpath too deep" pname = ".".join(pname.split(".")[:-level]) parent = self.modules[pname] self.msgout(4, "determine_parent ->", parent) return parent if caller.__path__: parent = self.modules[pname] assert caller is parent self.msgout(4, "determine_parent ->", parent) return parent if '.' in pname: i = pname.rfind('.') pname = pname[:i] parent = self.modules[pname] assert parent.__name__ == pname self.msgout(4, "determine_parent ->", parent) return parent self.msgout(4, "determine_parent -> None") return None def find_head_package(self, parent, name): self.msgin(4, "find_head_package", parent, name) if '.' in name: i = name.find('.') head = name[:i] tail = name[i+1:] else: head = name tail = "" if parent: qname = "%s.%s" % (parent.__name__, head) else: qname = head q = self.import_module(head, qname, parent) if q: self.msgout(4, "find_head_package ->", (q, tail)) return q, tail if parent: qname = head parent = None q = self.import_module(head, qname, parent) if q: self.msgout(4, "find_head_package ->", (q, tail)) return q, tail self.msgout(4, "raise ImportError: No module named", qname) raise ImportError, "No module named " + qname def load_tail(self, q, tail): self.msgin(4, "load_tail", q, tail) m = q while tail: i = tail.find('.') if i < 0: i = len(tail) head, tail = tail[:i], tail[i+1:] mname = "%s.%s" % (m.__name__, head) m = self.import_module(head, mname, m) if not m: self.msgout(4, "raise ImportError: No module named", mname) raise ImportError, "No module named " + mname self.msgout(4, "load_tail ->", m) return m def ensure_fromlist(self, m, fromlist, recursive=0): self.msg(4, "ensure_fromlist", m, fromlist, recursive) for sub in fromlist: if sub == "*": if not recursive: all = self.find_all_submodules(m) if all: self.ensure_fromlist(m, all, 1) elif not hasattr(m, sub): subname = "%s.%s" % (m.__name__, sub) submod = self.import_module(sub, subname, m) if not submod: raise ImportError, "No module named " + subname def find_all_submodules(self, m): if not m.__path__: return modules = {} # 'suffixes' used to be a list hardcoded to [".py", ".pyc", ".pyo"]. # But we must also collect Python extension modules - although # we cannot separate normal dlls from Python extensions. suffixes = [] for triple in imp.get_suffixes(): suffixes.append(triple[0]) for dir in m.__path__: try: names = os.listdir(dir) except os.error: self.msg(2, "can't list directory", dir) continue for name in names: mod = None for suff in suffixes: n = len(suff) if name[-n:] == suff: mod = name[:-n] break if mod and mod != "__init__": modules[mod] = mod return modules.keys() def import_module(self, partname, fqname, parent): self.msgin(3, "import_module", partname, fqname, parent) try: m = self.modules[fqname] except KeyError: pass else: self.msgout(3, "import_module ->", m) return m if fqname in self.badmodules: self.msgout(3, "import_module -> None") return None if parent and parent.__path__ is None: self.msgout(3, "import_module -> None") return None try: fp, pathname, stuff = self.find_module(partname, parent and parent.__path__, parent) except ImportError: self.msgout(3, "import_module ->", None) return None try: m = self.load_module(fqname, fp, pathname, stuff) finally: if fp: fp.close() if parent: setattr(parent, partname, m) self.msgout(3, "import_module ->", m) return m def load_module(self, fqname, fp, pathname, file_info): suffix, mode, type = file_info self.msgin(2, "load_module", fqname, fp and "fp", pathname) if type == imp.PKG_DIRECTORY: m = self.load_package(fqname, pathname) self.msgout(2, "load_module ->", m) return m if type == imp.PY_SOURCE: co = compile(fp.read()+'\n', pathname, 'exec') elif type == imp.PY_COMPILED: if fp.read(4) != imp.get_magic(): self.msgout(2, "raise ImportError: Bad magic number", pathname) raise ImportError, "Bad magic number in %s" % pathname fp.read(4) co = marshal.load(fp) else: co = None m = self.add_module(fqname) m.__file__ = pathname if co: if self.replace_paths: co = self.replace_paths_in_code(co) m.__code__ = co self.scan_code(co, m) self.msgout(2, "load_module ->", m) return m def _add_badmodule(self, name, caller): if name not in self.badmodules: self.badmodules[name] = {} if caller: self.badmodules[name][caller.__name__] = 1 else: self.badmodules[name]["-"] = 1 def _safe_import_hook(self, name, caller, fromlist, level=-1): # wrapper for self.import_hook() that won't raise ImportError if name in self.badmodules: self._add_badmodule(name, caller) return try: self.import_hook(name, caller, level=level) except ImportError, msg: self.msg(2, "ImportError:", str(msg)) self._add_badmodule(name, caller) else: if fromlist: for sub in fromlist: if sub in self.badmodules: self._add_badmodule(sub, caller) continue try: self.import_hook(name, caller, [sub], level=level) except ImportError, msg: self.msg(2, "ImportError:", str(msg)) fullname = name + "." + sub self._add_badmodule(fullname, caller) def scan_opcodes(self, co, unpack = struct.unpack): # Scan the code, and yield 'interesting' opcode combinations # Version for Python 2.4 and older code = co.co_code names = co.co_names consts = co.co_consts while code: c = code[0] if c in STORE_OPS: oparg, = unpack('<H', code[1:3]) yield "store", (names[oparg],) code = code[3:] continue if c == LOAD_CONST and code[3] == IMPORT_NAME: oparg_1, oparg_2 = unpack('<xHxH', code[:6]) yield "import", (consts[oparg_1], names[oparg_2]) code = code[6:] continue if c >= HAVE_ARGUMENT: code = code[3:] else: code = code[1:] def scan_opcodes_25(self, co, unpack = struct.unpack): # Scan the code, and yield 'interesting' opcode combinations # Python 2.5 version (has absolute and relative imports) code = co.co_code names = co.co_names consts = co.co_consts LOAD_LOAD_AND_IMPORT = LOAD_CONST + LOAD_CONST + IMPORT_NAME while code: c = code[0] if c in STORE_OPS: oparg, = unpack('<H', code[1:3]) yield "store", (names[oparg],) code = code[3:] continue if code[:9:3] == LOAD_LOAD_AND_IMPORT: oparg_1, oparg_2, oparg_3 = unpack('<xHxHxH', code[:9]) level = consts[oparg_1] if level == -1: # normal import yield "import", (consts[oparg_2], names[oparg_3]) elif level == 0: # absolute import yield "absolute_import", (consts[oparg_2], names[oparg_3]) else: # relative import yield "relative_import", (level, consts[oparg_2], names[oparg_3]) code = code[9:] continue if c >= HAVE_ARGUMENT: code = code[3:] else: code = code[1:] def scan_code(self, co, m): code = co.co_code if sys.version_info >= (2, 5): scanner = self.scan_opcodes_25 else: scanner = self.scan_opcodes for what, args in scanner(co): if what == "store": name, = args m.globalnames[name] = 1 elif what in ("import", "absolute_import"): fromlist, name = args have_star = 0 if fromlist is not None: if "*" in fromlist: have_star = 1 fromlist = [f for f in fromlist if f != "*"] if what == "absolute_import": level = 0 else: level = -1 self._safe_import_hook(name, m, fromlist, level=level) if have_star: # We've encountered an "import *". If it is a Python module, # the code has already been parsed and we can suck out the # global names. mm = None if m.__path__: # At this point we don't know whether 'name' is a # submodule of 'm' or a global module. Let's just try # the full name first. mm = self.modules.get(m.__name__ + "." + name) if mm is None: mm = self.modules.get(name) if mm is not None: m.globalnames.update(mm.globalnames) m.starimports.update(mm.starimports) if mm.__code__ is None: m.starimports[name] = 1 else: m.starimports[name] = 1 elif what == "relative_import": level, fromlist, name = args if name: self._safe_import_hook(name, m, fromlist, level=level) else: parent = self.determine_parent(m, level=level) self._safe_import_hook(parent.__name__, None, fromlist, level=0) else: # We don't expect anything else from the generator. raise RuntimeError(what) for c in co.co_consts: if isinstance(c, type(co)): self.scan_code(c, m) def load_package(self, fqname, pathname): self.msgin(2, "load_package", fqname, pathname) newname = replacePackageMap.get(fqname) if newname: fqname = newname m = self.add_module(fqname) m.__file__ = pathname m.__path__ = [pathname] # As per comment at top of file, simulate runtime __path__ additions. m.__path__ = m.__path__ + packagePathMap.get(fqname, []) fp, buf, stuff = self.find_module("__init__", m.__path__) self.load_module(fqname, fp, buf, stuff) self.msgout(2, "load_package ->", m) return m def add_module(self, fqname): if fqname in self.modules: return self.modules[fqname] self.modules[fqname] = m = Module(fqname) return m def find_module(self, name, path, parent=None): if parent is not None: # assert path is not None fullname = parent.__name__+'.'+name else: fullname = name if fullname in self.excludes: self.msgout(3, "find_module -> Excluded", fullname) raise ImportError, name if path is None: if name in sys.builtin_module_names: return (None, None, ("", "", imp.C_BUILTIN)) path = self.path return imp.find_module(name, path) def report(self): """Print a report to stdout, listing the found modules with their paths, as well as modules that are missing, or seem to be missing. """ print print " %-25s %s" % ("Name", "File") print " %-25s %s" % ("----", "----") # Print modules found keys = self.modules.keys() keys.sort() for key in keys: m = self.modules[key] if m.__path__: print "P", else: print "m", print "%-25s" % key, m.__file__ or "" # Print missing modules missing, maybe = self.any_missing_maybe() if missing: print print "Missing modules:" for name in missing: mods = self.badmodules[name].keys() mods.sort() print "?", name, "imported from", ', '.join(mods) # Print modules that may be missing, but then again, maybe not... if maybe: print print "Submodules thay appear to be missing, but could also be", print "global names in the parent package:" for name in maybe: mods = self.badmodules[name].keys() mods.sort() print "?", name, "imported from", ', '.join(mods) def any_missing(self): """Return a list of modules that appear to be missing. Use any_missing_maybe() if you want to know which modules are certain to be missing, and which *may* be missing. """ missing, maybe = self.any_missing_maybe() return missing + maybe def any_missing_maybe(self): """Return two lists, one with modules that are certainly missing and one with modules that *may* be missing. The latter names could either be submodules *or* just global names in the package. The reason it can't always be determined is that it's impossible to tell which names are imported when "from module import *" is done with an extension module, short of actually importing it. """ missing = [] maybe = [] for name in self.badmodules: if name in self.excludes: continue i = name.rfind(".") if i < 0: missing.append(name) continue subname = name[i+1:] pkgname = name[:i] pkg = self.modules.get(pkgname) if pkg is not None: if pkgname in self.badmodules[name]: # The package tried to import this module itself and # failed. It's definitely missing. missing.append(name) elif subname in pkg.globalnames: # It's a global in the package: definitely not missing. pass elif pkg.starimports: # It could be missing, but the package did an "import *" # from a non-Python module, so we simply can't be sure. maybe.append(name) else: # It's not a global in the package, the package didn't # do funny star imports, it's very likely to be missing. # The symbol could be inserted into the package from the # outside, but since that's not good style we simply list # it missing. missing.append(name) else: missing.append(name) missing.sort() maybe.sort() return missing, maybe def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f, r in self.replace_paths: if original_filename.startswith(f): new_filename = r + original_filename[len(f):] break if self.debug and original_filename not in self.processed_paths: if new_filename != original_filename: self.msgout(2, "co_filename %r changed to %r" \ % (original_filename,new_filename,)) else: self.msgout(2, "co_filename %r remains unchanged" \ % (original_filename,)) self.processed_paths.append(original_filename) consts = list(co.co_consts) for i in range(len(consts)): if isinstance(consts[i], type(co)): consts[i] = self.replace_paths_in_code(consts[i]) return types.CodeType(co.co_argcount, co.co_nlocals, co.co_stacksize, co.co_flags, co.co_code, tuple(consts), co.co_names, co.co_varnames, new_filename, co.co_name, co.co_firstlineno, co.co_lnotab, co.co_freevars, co.co_cellvars) def test(): # Parse command line import getopt try: opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:") except getopt.error, msg: print msg return # Process options debug = 1 domods = 0 addpath = [] exclude = [] for o, a in opts: if o == '-d': debug = debug + 1 if o == '-m': domods = 1 if o == '-p': addpath = addpath + a.split(os.pathsep) if o == '-q': debug = 0 if o == '-x': exclude.append(a) # Provide default arguments if not args: script = "hello.py" else: script = args[0] # Set the path based on sys.path and the script directory path = sys.path[:] path[0] = os.path.dirname(script) path = addpath + path if debug > 1: print "path:" for item in path: print " ", repr(item) # Create the module finder and turn its crank mf = ModuleFinder(path, debug, exclude) for arg in args[1:]: if arg == '-m': domods = 1 continue if domods: if arg[-2:] == '.*': mf.import_hook(arg[:-2], None, ["*"]) else: mf.import_hook(arg) else: mf.load_file(arg) mf.run_script(script) mf.report() return mf # for -i debugging if __name__ == '__main__': try: mf = test() except KeyboardInterrupt: print "\n[interrupt]"
Save