Changeset 493 in tailor


Ignore:
Timestamp:
08/05/05 02:36:45 (8 years ago)
Author:
lele@…
Hash name:
20050805003645-97f81-2c18ff5d46336f01867a82700a059c8bd72722c7
Message:

Reload global settings for every project

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/tailor.py

    r492 r493  
    7979 
    8080    def __call__(self, options): 
     81        from shwrap import ExternalCommand 
     82        from target import SyncronizableTargetWorkingDir 
     83        from changes import Changeset 
     84 
     85        def pconfig(option): 
     86            return self.project.config(self.project.name, option) 
     87 
     88        ExternalCommand.VERBOSE = pconfig('debug') 
     89        encoding = pconfig('encoding') 
     90        if encoding: 
     91            ExternalCommand.FORCE_ENCODING = encoding 
     92 
     93            # Make printouts be encoded as well. A better solution would be 
     94            # using the replace mechanism of the encoder, and keep printing 
     95            # in the user LC_CTYPE/LANG setting. 
     96 
     97            import codecs, sys 
     98            sys.stdout = codecs.getwriter(encoding)(sys.stdout) 
     99 
     100        pname_format = pconfig('patch-name-format') 
     101        if pname_format is not None: 
     102            SyncronizableTargetWorkingDir.PATCH_NAME_FORMAT = pname_format 
     103        SyncronizableTargetWorkingDir.REMOVE_FIRST_LOG_LINE = pconfig('remove-first-log-line') 
     104        Changeset.REFILL_MESSAGE = not pconfig('dont-refill-changelogs') 
     105 
    81106        if options.bootstrap: 
    82107            self.bootstrap() 
     
    225250    """ 
    226251 
    227     from os import getcwd, chdir 
    228     from os.path import abspath, exists, join 
    229     from shwrap import ExternalCommand 
    230     from target import SyncronizableTargetWorkingDir 
    231     from changes import Changeset 
     252    from os import getcwd 
    232253 
    233254    parser = OptionParser(usage='%prog [options] [project ...]', 
     
    249270 
    250271    options, args = parser.parse_args() 
    251  
    252     ExternalCommand.VERBOSE = options.debug 
    253     if options.encoding: 
    254         ExternalCommand.FORCE_ENCODING = options.encoding 
    255  
    256         # Make printouts be encoded as well. A better solution would be 
    257         # using the replace mechanism of the encoder, and keep printing 
    258         # in the user LC_CTYPE/LANG setting. 
    259  
    260         import codecs, sys 
    261         sys.stdout = codecs.getwriter(options.encoding)(sys.stdout) 
    262  
    263     if options.patch_name_format is not None: 
    264         SyncronizableTargetWorkingDir.PATCH_NAME_FORMAT = options.patch_name_format 
    265     SyncronizableTargetWorkingDir.REMOVE_FIRST_LOG_LINE = options.remove_first_log_line 
    266     Changeset.REFILL_MESSAGE = not options.dont_refill_changelogs 
    267272 
    268273    if options.interactive: 
Note: See TracChangeset for help on using the changeset viewer.