Changes in mergebot/trunk/mergebot/Actor.py [17:24]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mergebot/trunk/mergebot/Actor.py
r17 r24 1 """Base class for mergebot actors that do the various kinds of tasks 2 """ 1 3 import os 4 from mergebot import SvnOps 2 5 3 6 class Actor(object): 7 """Base class for mergebot actors""" 4 8 def __init__(self, work_dir, repo_url, repo_dir, ticket, component, 5 9 version, summary, requestor): … … 23 27 24 28 def logfilename(self): 29 """Returns the absolute path of the logfile for this ticket""" 25 30 return os.path.abspath(os.path.join(os.path.dirname(self.work_dir), 26 31 'ticket-%s.log' % self.ticket)) 27 32 28 33 def public_url(self): 34 """Returns the public URL for this component""" 29 35 return '%s/%s' % (self.repo_url, self.component) 30 36 … … 35 41 36 42 def local_url(self): 43 """Returns the local URL for this component""" 37 44 return 'file://%s/%s' % (self.repo_dir, self.component) 38 45 … … 48 55 49 56 def version_subdir(self): 57 """Returns the subdirectory name for the version""" 50 58 if self.version == 'trunk': 51 59 subdir = 'trunk' … … 58 66 return subdir 59 67 68 def check_required_directories(self): 69 """Make sure the various urls we require do exist""" 70 if not SvnOps.does_url_exist(self.local_url()): 71 return 'Component %s does not exist in the repository.' \ 72 % self.component 73 if not SvnOps.does_url_exist(self.local_url() + '/branches'): 74 return 'No directory in which to create branches for ' \ 75 'component %s in the repository.' % self.component 76 if not SvnOps.does_url_exist(self.baseline_local_url()): 77 return 'Version %s for component %s does not exist in the ' \ 78 'repository.' % (self.version, self.component) 79 return None 80
Note: See TracChangeset
for help on using the changeset viewer.