(self, filename)
| 31 | class FileHelper(object): |
| 32 | @classmethod |
| 33 | def loadResourceFile(self, filename): |
| 34 | if not os.path.isabs(filename): |
| 35 | dirpath = os.path.abspath(os.path.dirname(__file__)) |
| 36 | path = os.path.join(dirpath, 'resources', filename) |
| 37 | else: |
| 38 | path = filename |
| 39 | try: |
| 40 | f = codecs.open(path, 'r', 'utf-8') |
| 41 | content = f.read() |
| 42 | f.close() |
| 43 | return content |
| 44 | except IOError: |
| 45 | raise IOError("Couldn't open file %s" % path) |
| 46 | |
| 47 | |
| 48 | class ParsingCandidate(object): |