Set executable bits and add level arg to py2depgraph.mymf.import_hook().
[depgraph.git] / py2depgraph.py
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