Changeset 571 in tailor


Ignore:
Timestamp:
08/15/05 15:53:22 (8 years ago)
Author:
lele@…
Hash name:
20050815135322-97f81-049ce67302cc815d011f4074aa1425ad8810c29d
Message:

Redirect output of external command to /dev/null when it does not matter

Location:
vcpx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • vcpx/cvsps.py

    r566 r571  
    227227                retry = 0 
    228228                while True: 
    229                     cvsup.execute(e.name, stdout=PIPE) 
     229                    cvsup.execute(e.name) 
    230230 
    231231                    if cvsup.exit_status: 
  • vcpx/darcs.py

    r559 r571  
    270270                                       command=[self.repository.DARCS_CMD, 
    271271                                                "initialize"]) 
    272                 init.execute(stdout=PIPE) 
     272                init.execute() 
    273273 
    274274                if init.exit_status: 
     
    359359 
    360360        record = ExternalCommand(cwd=self.basedir, command=cmd) 
    361         record.execute(entries, input='\n'.join(logmessage), stdout=PIPE) 
     361        record.execute(entries, input='\n'.join(logmessage)) 
    362362 
    363363        if record.exit_status: 
     
    424424                               command=[self.repository.DARCS_CMD, 
    425425                                        "initialize"]) 
    426         init.execute(stdout=PIPE) 
     426        init.execute() 
    427427 
    428428        if init.exit_status: 
  • vcpx/svn.py

    r547 r571  
    415415        cmd = [self.repository.SVN_CMD, "info"] 
    416416        svninfo = ExternalCommand(command=cmd) 
    417         svninfo.execute(self.repository.repository, stdout=PIPE, stderr=STDOUT) 
     417        svninfo.execute(self.repository.repository) 
    418418 
    419419        if svninfo.exit_status: 
  • vcpx/shwrap.py

    r568 r571  
    116116 
    117117        from sys import stderr, getdefaultencoding 
    118         from os import environ 
     118        import os 
    119119        from cStringIO import StringIO 
    120120 
     
    138138        if not kwargs.has_key('env'): 
    139139            env = kwargs['env'] = {} 
    140             env.update(environ) 
     140            env.update(os.environ) 
    141141 
    142142            for v in ['LANG', 'TZ', 'PATH']: 
     
    145145 
    146146        input = kwargs.get('input') 
    147  
     147        output = kwargs.get('stdout') 
     148        error = kwargs.get('stderr') 
     149        devnull = getattr(os, 'devnull', '/dev/null') 
     150        if output is None: 
     151            output = open(devnull, 'w') 
     152        if error is None: 
     153            error = open(devnull, 'w') 
    148154        try: 
    149155            process = Popen(self._last_command, 
    150156                            stdin=input and PIPE or None, 
    151                             stdout=kwargs.get('stdout'), 
    152                             stderr=kwargs.get('stderr'), 
     157                            stdout=output, 
     158                            stderr=error, 
    153159                            env=kwargs.get('env'), 
    154160                            cwd=kwargs.get('cwd'), 
Note: See TracChangeset for help on using the changeset viewer.