Set executable bits and add level arg to py2depgraph.mymf.import_hook().
authorW. Trevor King <wking@drexel.edu>
Sun, 9 Jan 2011 02:45:12 +0000 (21:45 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 9 Jan 2011 02:45:12 +0000 (21:45 -0500)
README
depgraph2dot.py [changed mode: 0644->0755]
py2depgraph.py [changed mode: 0644->0755]

diff --git a/README b/README
index cbc6e5f7e1c2b51134cb56b7014fbd7f61a84830..db51f4e27c4e4e9500c9c329e37a812f3ed7dbcd 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ Originals from: "Toby Dickenson" <toby@tarind.com>
 http://tarind.com/depgraph.html
 
 Generate python module dependency graphs using dot (graphviz package)
-$ python py2depgraph.py path/to/my/script.py | python depgraph2dot.py | dot -T png -o depgraph.png
+$ py2depgraph.py path/to/my/script.py | depgraph2dot.py | dot -T png -o depgraph.png
 
 I added some code to also save the path of any modules, 
 so it would be easier to only print modules with particular paths, 
old mode 100644 (file)
new mode 100755 (executable)
index 594e486..6d11157
@@ -1,7 +1,7 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # Copyright 2004      Toby Dickenson
-# Copyright 2008-2010 W. Trevor King
+# Copyright 2008-2011 W. Trevor King
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
old mode 100644 (file)
new mode 100755 (executable)
index f2bfe29..cb2bc86
@@ -1,5 +1,7 @@
+#!/usr/bin/env python
+#
 # Copyright 2004      Toby Dickenson
-# Copyright 2008-2010 W. Trevor King
+# Copyright 2008-2011 W. Trevor King
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,11 +33,11 @@ class mymf(modulefinder.ModuleFinder):
         self._last_caller = None
         modulefinder.ModuleFinder.__init__(self,*args,**kwargs)
         
-    def import_hook(self, name, caller=None, fromlist=None):
+    def import_hook(self, name, caller=None, fromlist=None, level=-1):
         old_last_caller = self._last_caller
         try:
             self._last_caller = caller
-            return modulefinder.ModuleFinder.import_hook(self,name,caller,fromlist)
+            return modulefinder.ModuleFinder.import_hook(self,name,caller,fromlist, level)
         finally:
             self._last_caller = old_last_caller