From: Fredrik Tolf Date: Sun, 14 Sep 2014 03:48:24 +0000 (+0200) Subject: Added a small utility library. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=efdb7a220fe10c6dd82b13991f1f20343479dcd4;p=pycfml.git Added a small utility library. --- diff --git a/classfile/util.py b/classfile/util.py new file mode 100644 index 0000000..24e07a8 --- /dev/null +++ b/classfile/util.py @@ -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]