Added a small utility library.
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 14 Sep 2014 03:48:24 +0000 (05:48 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 14 Sep 2014 03:48:24 +0000 (05:48 +0200)
classfile/util.py [new file with mode: 0644]

diff --git a/classfile/util.py b/classfile/util.py
new file mode 100644 (file)
index 0000000..24e07a8
--- /dev/null
@@ -0,0 +1,5 @@
+def resource(cls, newfile, lnoff):
+    cls.srcfile = cls.intern(newfile, True)
+    for method in cls.methods:
+        if method.code and method.code.lintab:
+            method.code.lintab = [(pc, lin + lnoff) for pc, lin in method.code.lintab]