/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/program.py

  • Committer: Tim Marston
  • Date: 2014-02-26 19:10:31 UTC
  • Revision ID: tim@ed.am-20140226191031-elcqy5j09h2syn2j
moved copy-in, copy-out and deployment conflict checking to a set of "walkers";
bzr vcs back-end now parses affected files during update; deployment state now
includes affected files

Show diffs side-by-side

added added

removed removed

21
21
 
22
22
import os, sys, getopt
23
23
import the
 
24
from vcs.vcs import Vcs
24
25
 
25
26
 
26
27
class Program:
185
186
                try:
186
187
                        instance.parse_command_line()
187
188
                        instance.run()
188
 
                except ( getopt.GetoptError, self.UsageError ) as e:
 
189
                except( getopt.GetoptError, self.UsageError ) as e:
189
190
                        self.print_usage( e.msg )
190
 
                except self.FatalError as e:
 
191
                except Vcs.VcsError as e:
191
192
                        message = e.msg.rstrip()
192
193
                        if the.verbose and hasattr( e, 'output' ) and e.output:
193
194
                                message += '\n\nOUTPUT:\n' + e.output.rstrip()
194
195
                        self.die( message )
 
196
                except self.FatalError as e:
 
197
                        self.die( e.msg )
195
198
 
196
199
 
197
200
        class UsageError( Exception ):
202
205
 
203
206
        class FatalError( Exception ):
204
207
 
205
 
                def __init__( self, message, output = None ):
 
208
                def __init__( self, message ):
206
209
                        self.msg = message
207
 
                        self.output = output