Added a small utility library.
[pycfml.git] / classfile / util.py
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]