Changeset b0fa2ae in rtems-tools for rtemstoolkit
- Timestamp:
- Mar 3, 2016, 5:46:18 AM (4 years ago)
- Branches:
- 4.10, master
- Children:
- a5d243d
- Parents:
- 0e5d89d
- git-author:
- Chris Johns <chrisj@…> (03/03/16 05:46:18)
- git-committer:
- Chris Johns <chrisj@…> (03/03/16 05:53:39)
- Location:
- rtemstoolkit
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
rtemstoolkit/__init__.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 38 38 'mailer', 39 39 'options', 40 'path'] 40 'path', 41 'version'] 42 43 from . import check 44 from . import config 45 from . import error 46 from . import execute 47 from . import git 48 from . import log 49 from . import macros 50 from . import mailer 51 from . import options 52 from . import path 53 from . import version -
rtemstoolkit/check.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 33 33 # 34 34 35 from __future__ import print_function 36 35 37 import os 36 38 37 import error 38 import execute 39 import log 40 import options 41 import path 42 import version 39 # 40 # Support to handle use in a package and as a unit test. 41 # If there is a better way to let us know. 42 # 43 try: 44 from . import error 45 from . import execute 46 from . import log 47 from . import options 48 from . import path 49 from . import version 50 except (ValueError, SystemError): 51 import error 52 import execute 53 import log 54 import options 55 import path 56 import version 43 57 44 58 def _check_none(_opts, macro, value, constraint): … … 118 132 sane = True 119 133 120 for d in opts.defaults.keys():134 for d in list(opts.defaults.keys()): 121 135 try: 122 136 (test, constraint, value) = opts.defaults.get(d) … … 153 167 import sys 154 168 try: 155 _opts = options.load(args = sys.argv) 169 _opts = options.command_line(argv = sys.argv) 170 options.load(_opts) 156 171 log.notice('RTEMS Source Builder - Check, v%s' % (version.str())) 157 172 if host_setup(_opts): -
rtemstoolkit/config.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 37 37 # 38 38 39 from __future__ import print_function 40 39 41 import copy 42 import functools 40 43 import os 41 44 import re 42 45 import sys 43 46 44 import error45 import execute46 import log47 import options48 import path49 50 47 try: 51 import error52 import execute53 import log54 import options55 import path56 except KeyboardInterrupt:57 print('user terminated')58 sys.exit(1)59 except: 60 print('error: unknown application load error')61 sys.exit(1)48 from . import error 49 from . import execute 50 from . import log 51 from . import options 52 from . import path 53 except (ValueError, SystemError): 54 import error 55 import execute 56 import log 57 import options 58 import path 62 59 63 60 def _check_bool(value): … … 97 94 self._includes = [] 98 95 self.load_depth = 0 96 self.lc = 0 97 self.name = 'none' 99 98 100 99 def __del__(self): … … 105 104 def _dict(dd): 106 105 s = '' 107 ddl = dd.keys()106 ddl = list(dd.keys()) 108 107 ddl.sort() 109 108 for d in ddl: … … 439 438 istrue = _check_bool(ifls[0]) 440 439 if istrue == None: 441 self._error('invalid if bool value: ' + reduce(add, ls, ''))440 self._error('invalid if bool value: ' + functools.reduce(add, ls, '')) 442 441 istrue = False 443 442 elif len(ifls) == 2: … … 445 444 istrue = _check_bool(ifls[1]) 446 445 if istrue == None: 447 self._error('invalid if bool value: ' + reduce(add, ls, ''))446 self._error('invalid if bool value: ' + functools.reduce(add, ls, '')) 448 447 istrue = False 449 448 else: … … 461 460 istrue = True 462 461 else: 463 self._error('invalid if bool operator: ' + reduce(add, ls, ''))462 self._error('invalid if bool operator: ' + functools.reduce(add, ls, '')) 464 463 elif len(ifls) == 3: 465 464 if ifls[1] == '==': … … 494 493 istrue = False 495 494 else: 496 self._error('invalid %if operator: ' + reduce(add, ls, ''))497 else: 498 self._error('malformed if: ' + reduce(add, ls, ''))495 self._error('invalid %if operator: ' + functools.reduce(add, ls, '')) 496 else: 497 self._error('malformed if: ' + functools.reduce(add, ls, '')) 499 498 if invert: 500 499 istrue = not istrue … … 843 842 # Run where defaults.mc is located 844 843 # 845 opts = options.load(sys.argv, defaults = 'defaults.mc') 846 log.trace('config: count %d' % (len(opts.config_files()))) 847 for config_file in opts.config_files(): 848 s = file(config_file, opts) 849 print(s) 850 del s 844 long_opts = { 845 # key macro handler param defs init 846 '--file' : ('_file', 'path', True, None, False) 847 } 848 opts = options.command_line(base_path = '.', 849 argv = sys.argv, 850 long_opts = long_opts) 851 options.load(opts) 852 if '_file' not in opts.defaults: 853 raise error.general('no --file option provided') 854 s = file(opts.defaults['_file'], opts) 855 s.load(opts.defaults['_file']) 856 print(s) 857 del s 851 858 except error.general as gerr: 852 859 print(gerr) -
rtemstoolkit/darwin.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 36 36 import os 37 37 38 import execute 38 # 39 # Support to handle use in a package and as a unit test. 40 # If there is a better way to let us know. 41 # 42 try: 43 from . import execute 44 except (ValueError, SystemError): 45 import execute 39 46 40 47 def load(): -
rtemstoolkit/error.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 32 32 # Various errors we can raise. 33 33 # 34 35 from __future__ import print_function 34 36 35 37 class error(Exception): -
rtemstoolkit/execute.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 35 35 # 36 36 37 from __future__ import print_function 38 39 import functools 37 40 import os 38 41 import re … … 42 45 import time 43 46 44 import error 45 import log 47 # 48 # Support to handle use in a package and as a unit test. 49 # If there is a better way to let us know. 50 # 51 try: 52 from . import error 53 from . import log 54 except (ValueError, SystemError): 55 import error 56 import log 46 57 47 58 # Trace exceptions … … 97 108 cmd = arg_subst(command, subst) 98 109 def add(x, y): return x + ' ' + str(y) 99 return reduce(add, cmd, '')110 return functools.reduce(add, cmd, '') 100 111 101 112 class execute(object): … … 119 130 self.proc = None 120 131 121 def _capture(self, command, proc, timeout = None):132 def capture(self, proc, command = 'pipe', timeout = None): 122 133 """Create 3 threads to read stdout and stderr and send to the output handler 123 134 and call an input handler is provided. Based on the 'communicate' code … … 129 140 if trace_threads: 130 141 print('executte:_writethread: start') 142 encoding = True 143 try: 144 tmp = bytes('temp', sys.stdin.encoding) 145 except: 146 encoding = False 131 147 try: 132 148 while True: 133 lines = input()134 if type(lines) == str :149 lines = eval(input()) 150 if type(lines) == str or type(lines) == bytes: 135 151 try: 152 if encoding: 153 lines = bytes(lines, sys.stdin.encoding) 136 154 fh.write(lines) 137 155 except: … … 156 174 until the file closes.""" 157 175 def _output_line(line, exe, prefix, out, count): 158 #print 'LINE:%d: %s' % (count, line) 159 exe.lock.acquire() 176 #exe.lock.acquire() 160 177 #exe.outputting = True 161 exe.lock.release()178 #exe.lock.release() 162 179 if out: 163 180 out(prefix + line) … … 176 193 if len(data) == 0: 177 194 break 178 #print '))))) %02x "%s"' % (ord(data), data) 195 if type(data) == bytes: 196 data = data.decode(sys.stdout.encoding) 179 197 for c in data: 180 198 line += c … … 306 324 if type(command) is list: 307 325 def add(x, y): return x + ' ' + str(y) 308 s = reduce(add, command, '')[1:]326 s = functools.reduce(add, command, '')[1:] 309 327 what = 'spawn' 310 328 if shell: 311 329 what = 'shell' 312 330 log.output(what + ': ' + s) 331 if self.output is None: 332 raise error.general('capture needs an output handler') 313 333 if shell and self.shell_exe: 314 334 command = arg_list(command) … … 343 363 if self.output is None: 344 364 raise error.general('capture needs an output handler') 345 exit_code = self. _capture(command, proc, timeout)365 exit_code = self.capture(proc, command, timeout) 346 366 if self.verbose: 347 367 log.output('exit: ' + str(exit_code)) … … 396 416 cwd = cwd, env = env, 397 417 stdin = stdin, stdout = stdout, stderr = stderr, 398 itmeout = timeout)418 timeout = timeout) 399 419 400 420 def set_shell(self, execute): … … 520 540 print('piping input into ' + commands['pipe'][0] + ': ' + \ 521 541 commands['pipe'][2]) 522 proc.stdin.write(commands['pipe'][2]) 542 try: 543 out = bytes(commands['pipe'][2], sys.stdin.encoding) 544 except: 545 out = commands['pipe'][2] 546 proc.stdin.write(out) 523 547 proc.stdin.close() 524 548 e.capture(proc) 525 549 del proc 550 551 def capture_output(text): 552 print(text, end = '') 526 553 527 554 cmd_shell_test = 'if "%OS%" == "Windows_NT" (echo It is WinNT) else echo Is is not WinNT' … … 550 577 ['subst0', 'subst1', 'subst2'])) 551 578 552 e = execute(error_prefix = 'ERR: ', verbose = True)579 e = execute(error_prefix = 'ERR: ', output = capture_output, verbose = True) 553 580 if sys.platform == "win32": 554 581 run_tests(e, commands['windows'], False) -
rtemstoolkit/freebsd.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 37 37 import os 38 38 39 import check 40 import execute 39 # 40 # Support to handle use in a package and as a unit test. 41 # If there is a better way to let us know. 42 # 43 try: 44 from . import check 45 from . import execute 46 except (ValueError, SystemError): 47 import check 48 import execute 41 49 42 50 def load(): -
rtemstoolkit/git.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 5Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 32 32 import os 33 33 34 import error 35 import execute 36 import log 37 import options 38 import path 34 # 35 # Support to handle use in a package and as a unit test. 36 # If there is a better way to let us know. 37 # 38 try: 39 from . import error 40 from . import execute 41 from . import log 42 from . import path 43 except (ValueError, SystemError): 44 import error 45 import execute 46 import log 47 import path 39 48 40 49 class repo: 41 50 """An object to manage a git repo.""" 42 51 43 def _git_exit_code(self, ec ):52 def _git_exit_code(self, ec, cmd, output): 44 53 if ec: 54 log.notice('git: cmd: ' + ' '.join(cmd)) 55 log.notice('git: output: ' + output) 45 56 raise error.general('git command failed (%s): %d' % (self.git, ec)) 46 57 … … 56 67 log.trace(output) 57 68 if check: 58 self._git_exit_code(exit_code )69 self._git_exit_code(exit_code, cmd, output) 59 70 return exit_code, output 60 71 … … 77 88 raise error.general('invalid version string from git: %s' % (output)) 78 89 vs = gvs[2].split('.') 79 if len(vs) != 4: 80 raise error.general('invalid version number from git: %s' % (gvs[2])) 81 return (int(vs[0]), int(vs[1]), int(vs[2]), int(vs[3])) 90 if len(vs) == 4: 91 return (int(vs[0]), int(vs[1]), int(vs[2]), int(vs[3])) 92 if len(vs) == 3: 93 return (int(vs[0]), int(vs[1]), int(vs[2])) 94 raise error.general('invalid version number from git: %s' % (gvs[2])) 82 95 83 96 def clone(self, url, _path): … … 208 221 if __name__ == '__main__': 209 222 import sys 210 opts = options.load(sys.argv) 223 import options 224 long_opts = { 225 # key macro handler param defs init 226 } 227 opts = options.command_line(base_path = '.', 228 argv = sys.argv, 229 long_opts = long_opts) 230 options.load(opts) 211 231 g = repo('.', opts) 212 print( g.git_version())213 print( g.valid())214 print( g.status())215 print( g.clean())216 print( g.remotes())217 print( g.email())218 print( g.head())232 print('version:', g.git_version()) 233 print('valid:', g.valid()) 234 print('status:', g.status()) 235 print('dirty:', g.dirty()) 236 print('remotes:', g.remotes()) 237 print('email:', g.email()) 238 print('head:', g.head()) -
rtemstoolkit/linux.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 36 36 import pprint 37 37 import os 38 import platform 38 39 39 import platform 40 import execute 41 import path 40 # 41 # Support to handle use in a package and as a unit test. 42 # If there is a better way to let us know. 43 # 44 try: 45 from . import execute 46 from . import path 47 except (ValueError, SystemError): 48 import execute 49 import path 42 50 43 51 def load(): … … 131 139 } 132 140 133 if variations.has_key(distro):141 if distro in variations: 134 142 for v in variations[distro]: 135 143 if path.exists(variations[distro][v][2]): -
rtemstoolkit/log.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 33 33 # 34 34 35 from __future__ import print_function 36 35 37 import os 36 38 import sys 37 39 import threading 38 40 39 import error 41 # 42 # Support to handle use in a package and as a unit test. 43 # If there is a better way to let us know. 44 # 45 try: 46 from . import error 47 except (ValueError, SystemError): 48 import error 40 49 41 50 # … … 127 136 else: 128 137 try: 129 self.fhs.append( file(s, 'w'))138 self.fhs.append(open(s, 'w')) 130 139 except IOError as ioe: 131 140 raise error.general("creating log file '" + s + \ -
rtemstoolkit/macros.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 33 33 # 34 34 35 from __future__ import print_function 36 35 37 import copy 36 38 import inspect … … 39 41 import string 40 42 41 import error 42 import path 43 # 44 # Support to handle use in a package and as a unit test. 45 # If there is a better way to let us know. 46 # 47 try: 48 from . import error 49 from . import path 50 except (ValueError, SystemError): 51 import error 52 import path 43 53 44 54 # … … 55 65 return self 56 66 57 def next(self):67 def __next__(self): 58 68 if self.index < len(self.keys): 59 69 key = self.keys[self.index] … … 64 74 def iterkeys(self): 65 75 return self.keys 76 77 def _unicode_to_str(self, us): 78 try: 79 if type(us) == unicode: 80 return us.encode('ascii', 'replace') 81 except: 82 pass 83 try: 84 if type(us) == bytes: 85 return us.encode('ascii', 'replace') 86 except: 87 pass 88 return us 66 89 67 90 def __init__(self, name = None, original = None, rtdir = '.'): … … 168 191 if type(key) is not str: 169 192 raise TypeError('bad key type (want str): %s' % (type(key))) 193 if type(value) is not tuple: 194 value = self._unicode_to_str(value) 170 195 if type(value) is str: 171 196 value = ('none', 'none', value) … … 174 199 if len(value) != 3: 175 200 raise TypeError('bad value tuple (len not 3): %d' % (len(value))) 201 value = (self._unicode_to_str(value[0]), 202 self._unicode_to_str(value[1]), 203 self._unicode_to_str(value[2])) 176 204 if type(value[0]) is not str: 177 205 raise TypeError('bad value tuple type field: %s' % (type(value[0]))) … … 196 224 197 225 def __len__(self): 198 return len( self.keys())226 return len(list(self.keys())) 199 227 200 228 def keys(self): 201 keys = self.macros['global'].keys()229 keys = list(self.macros['global'].keys()) 202 230 for rm in self.get_read_maps(): 203 231 for mk in self.macros[rm]: … … 212 240 if type(key) is not str: 213 241 raise TypeError('bad key type (want str): %s' % (type(key))) 214 if self.key_filter(key) not in self.keys():242 if self.key_filter(key) not in list(self.keys()): 215 243 return False 216 244 return True … … 492 520 import sys 493 521 print(inspect.getfile(macros)) 494 m = macros( name = 'defaults.mc')522 m = macros() 495 523 d = copy.copy(m) 496 524 m['test1'] = 'something' -
rtemstoolkit/mailer.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2013-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2013-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 33 33 # 34 34 35 from __future__ import print_function 36 35 37 import os 36 38 import smtplib 37 39 import socket 38 40 39 import error 40 import options 41 import path 41 # 42 # Support to handle use in a package and as a unit test. 43 # If there is a better way to let us know. 44 # 45 try: 46 from . import error 47 from . import options 48 from . import path 49 except (ValueError, SystemError): 50 import error 51 import options 52 import path 42 53 43 54 def append_options(opts): -
rtemstoolkit/options.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 33 33 # 34 34 35 from __future__ import print_function 36 35 37 import copy 36 38 import glob … … 39 41 import os 40 42 import string 41 42 import error43 import execute44 import git45 import log46 import macros47 import path48 43 import sys 49 44 50 import version 45 # 46 # Support to handle use in a package and as a unit test. 47 # If there is a better way to let us know. 48 # 49 try: 50 from . import error 51 from . import execute 52 from . import git 53 from . import log 54 from . import macros 55 from . import path 56 from . import version 57 except (ValueError, SystemError): 58 import error 59 import execute 60 import git 61 import log 62 import macros 63 import path 64 import version 51 65 52 66 basepath = 'tb' … … 62 76 def __init__(self, base_path = None, argv = None, optargs = None, 63 77 defaults = None, long_opts = None, long_opts_help = None, 64 command_path = None, log_default = None):78 command_path = '', log_default = None): 65 79 66 80 if argv is None: … … 70 84 71 85 if long_opts == None: 72 raise error.general('No options provided')86 long_opts = {} 73 87 74 88 basepath = base_path … … 77 91 raise error.general('log default is a list') 78 92 self.log_default = log_default 93 94 if defaults is None: 95 defaults = macros.macros() 79 96 80 97 self.long_opts = { … … 129 146 handler = self._lo_string 130 147 elif long_opts[lo][1] == 'path': 131 han lder = self._lo_path148 handler = self._lo_path 132 149 elif long_opts[lo][1] == 'jobs': 133 150 handler = self._lo_jobs … … 140 157 self.long_opts[lo] = (long_opts[lo][0], handler, long_opts[lo][2], 141 158 long_opts[lo][3], long_opts[lo][4]) 142 if lo not in long_opts_help: 143 raise error.general('no help for option: %s' % (lo)) 144 self.long_opts_help[lo] = long_opts_help[lo] 159 if long_opts_help is not None: 160 if lo not in long_opts_help: 161 raise error.general('no help for option: %s' % (lo)) 162 self.long_opts_help[lo] = long_opts_help[lo] 145 163 146 164 def __copy__(self): … … 160 178 def _dict(dd): 161 179 s = '' 162 ddl = dd.keys()180 ddl = list(dd.keys()) 163 181 ddl.sort() 164 182 for d in ddl: … … 277 295 print('RTEMS Tools Project (c) 2012-2015 Chris Johns') 278 296 print('Options and arguments:') 279 opts = self.long_opts_help.keys()297 opts = list(self.long_opts_help.keys()) 280 298 if self.optargs: 281 299 opts += self.optargs.keys() … … 519 537 """ 520 538 539 if not isinstance(opts, command_line): 540 raise error.general('invalid options type passed to options loader') 541 521 542 global host_windows 522 543 … … 533 554 try: 534 555 if uname[0].startswith('CYGWIN_NT'): 535 import windows 556 try: 557 from . import windows 558 except: 559 import windows 536 560 overrides = windows.load() 537 561 elif uname[0] == 'Darwin': 538 import darwin 562 try: 563 from . import darwin 564 except: 565 import darwin 539 566 overrides = darwin.load() 540 567 elif uname[0] == 'FreeBSD': 541 import freebsd 568 try: 569 from . import freebsd 570 except: 571 import freebsd 542 572 overrides = freebsd.load() 543 573 elif uname[0] == 'NetBSD': 544 import netbsd 574 try: 575 from . import netbsd 576 except: 577 import netbsd 545 578 overrides = netbsd.load() 546 579 elif uname[0] == 'Linux': 547 import linux 580 try: 581 from . import linux 582 except: 583 import linux 548 584 overrides = linux.load() 585 elif uname[0] == 'SunOS': 586 try: 587 from . import solaris 588 except: 589 import solaris 590 overrides = solaris.load() 549 591 except: 550 592 raise error.general('failed to load %s host support' % (uname[0])) -
rtemstoolkit/path.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 35 35 # 36 36 37 from __future__ import print_function 38 37 39 import glob 38 40 import os … … 40 42 import string 41 43 42 import error 43 import log 44 # 45 # Support to handle use in a package and as a unit test. 46 # If there is a better way to let us know. 47 # 48 try: 49 from . import error 50 from . import log 51 except (ValueError, SystemError): 52 import error 53 import log 44 54 45 55 windows = os.name == 'nt' -
rtemstoolkit/version.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 5Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 34 34 # 35 35 36 from __future__ import print_function 37 36 38 import sys 37 39 38 import error 39 import path 40 # 41 # Support to handle use in a package and as a unit test. 42 # If there is a better way to let us know. 43 # 44 try: 45 from . import error 46 from . import git 47 from . import path 48 except (ValueError, SystemError): 49 import error 50 import git 51 import path 40 52 41 53 # … … 68 80 69 81 def _load_git_version(): 70 import git71 82 global _git 72 83 global _version_str -
rtemstoolkit/windows.py
r0e5d89d rb0fa2ae 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2016 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 33 33 # 34 34 35 import error36 35 import pprint 37 36 import os 38 37 39 import execute 38 # 39 # Support to handle use in a package and as a unit test. 40 # If there is a better way to let us know. 41 # 42 try: 43 from . import error 44 from . import execute 45 except (ValueError, SystemError): 46 import error 47 import execute 40 48 41 49 def load():
Note: See TracChangeset
for help on using the changeset viewer.