Changeset 4727c3e in rtems-source-builder
- Timestamp:
- 04/02/20 04:29:31 (3 years ago)
- Branches:
- 5, master
- Children:
- ad90540
- Parents:
- 113c65c
- git-author:
- Gedare Bloom <gedare@…> (04/02/20 04:29:31)
- git-committer:
- Gedare Bloom <gedare@…> (04/05/20 04:11:00)
- Location:
- source-builder/sb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source-builder/sb/reports.py
r113c65c r4727c3e 242 242 self.line('') 243 243 rc = 1 244 for r in remotes: 245 if 'url' in remotes[r]: 246 text = remotes[r]['url'] 247 else: 248 text = 'no URL found' 249 self.line('%d. %s: %s' % (rc, r, text)) 250 rc += 1 244 if not remotes: 245 self.line('[ remotes removed, contact sender for details ]') 246 else: 247 for r in remotes: 248 if 'url' in remotes[r]: 249 text = remotes[r]['url'] 250 else: 251 text = 'no URL found' 252 self.line('%d. %s: %s' % (rc, r, text)) 253 rc += 1 251 254 self.line('') 252 255 self.line(self._strong('Status:')) … … 428 431 self.line('%s Remotes:' % (self.cini)) 429 432 rc = 0 430 for r in remotes: 431 rc += 1 432 if 'url' in remotes[r]: 433 text = remotes[r]['url'] 434 else: 435 text = 'no URL found' 436 text = '%s: %s' % (r, text) 437 self.line('%s %2d: %s' % (self.cini, rc, text)) 433 if not remotes: 434 self.line('[ remotes removed, contact sender for details ]') 435 else: 436 for r in remotes: 437 rc += 1 438 if 'url' in remotes[r]: 439 text = remotes[r]['url'] 440 else: 441 text = 'no URL found' 442 text = '%s: %s' % (r, text) 443 self.line('%s %2d: %s' % (self.cini, rc, text)) 438 444 self.line('%s Status:' % (self.cini)) 439 445 if dirty: … … 604 610 """Report the build details about a package given a config file.""" 605 611 606 def __init__(self, formatter, _configs, opts, macros = None):612 def __init__(self, formatter, sanitize, _configs, opts, macros = None): 607 613 if type(formatter) == str: 608 614 if formatter == 'text': … … 622 628 self.configs = _configs 623 629 self.opts = opts 630 self.sanitize = sanitize 624 631 if macros is None: 625 632 self.macros = opts.defaults … … 650 657 def git_status(self): 651 658 r = git.repo('.', self.opts, self.macros) 652 self.formatter.git_status(r.valid(), r.dirty(), r.head(), r.remotes()) 659 if self.sanitize: 660 self.formatter.git_status(r.valid(), r.dirty(), r.head(), None) 661 else: 662 self.formatter.git_status(r.valid(), r.dirty(), r.head(), r.remotes()) 653 663 654 664 def introduction(self, name, intro_text = None): … … 893 903 '--list-configs': 'List available configurations', 894 904 '--format': 'Output format (text, html, markdown, ini, xml)', 895 '--output': 'File name to output the report' } 905 '--output': 'File name to output the report', 906 '--sanitize': 'Remove Remotes information from report'} 896 907 opts = options.load(args, optargs, logfile = False) 897 908 if opts.get_arg('--output') and len(opts.params()) > 1: … … 923 934 else: 924 935 raise error.general('invalid format: %s' % (format_opt[1])) 925 r = report(formatter, configs, opts) 936 sanitize = False 937 if opts.get_arg('--sanitize'): 938 sanitize = True 939 r = report(formatter, sanitize, configs, opts) 926 940 for _config in opts.params(): 927 941 if output is None: -
source-builder/sb/setbuilder.py
r113c65c r4727c3e 190 190 else: 191 191 outname = None 192 r = reports.report(format, self.configs,192 r = reports.report(format, False, self.configs, 193 193 copy.copy(opts), copy.copy(macros)) 194 194 r.introduction(_build.config.file_name()) … … 200 200 del r 201 201 if mail: 202 r = reports.report('text', self.configs,202 r = reports.report('text', True, self.configs, 203 203 copy.copy(opts), copy.copy(macros)) 204 204 r.introduction(_build.config.file_name())
Note: See TracChangeset
for help on using the changeset viewer.