Mercurial > lcfOS
annotate python/ppci/__init__.py @ 393:6ae782a085e0
Added init program
author | Windel Bouwman |
---|---|
date | Sat, 17 May 2014 21:17:40 +0200 |
parents | 173e20a47fda |
children |
rev | line source |
---|---|
1 | 1 # File to make this directory a package. |
2 | |
106 | 3 import sys |
336
d1ecc493384e
Added spiffy armtoken class for bit fiddeling. Added cool test that checks for build repeatability
Windel Bouwman
parents:
331
diff
changeset
|
4 import os |
106 | 5 |
99 | 6 version = '0.0.1' |
7 | |
106 | 8 # Assert python version: |
9 if sys.version_info.major != 3: | |
10 print("Needs to be run in python version 3.x") | |
11 sys.exit(1) | |
12 | |
191 | 13 from .common import SourceLocation, SourceRange, Token |
312 | 14 from .common import CompilerError, DiagnosticsManager |
331 | 15 |
16 logformat='%(asctime)s|%(levelname)s|%(name)s|%(message)s' | |
17 | |
336
d1ecc493384e
Added spiffy armtoken class for bit fiddeling. Added cool test that checks for build repeatability
Windel Bouwman
parents:
331
diff
changeset
|
18 def same_dir(full_path, filename): |
d1ecc493384e
Added spiffy armtoken class for bit fiddeling. Added cool test that checks for build repeatability
Windel Bouwman
parents:
331
diff
changeset
|
19 return os.path.join(os.path.dirname(os.path.abspath(full_path)), filename) |
383 | 20 |
21 | |
22 def make_num(txt): | |
23 if txt.startswith('0x'): | |
24 return int(txt[2:], 16) | |
25 else: | |
26 return int(txt) | |
27 |