Ignore:
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"""
    13import os
     4from mergebot import SvnOps
    25
    36class Actor(object):
     7    """Base class for mergebot actors"""
    48    def __init__(self, work_dir, repo_url, repo_dir, ticket, component,
    59                 version, summary, requestor):
     
    2327
    2428    def logfilename(self):
     29        """Returns the absolute path of the logfile for this ticket"""
    2530        return os.path.abspath(os.path.join(os.path.dirname(self.work_dir),
    2631            'ticket-%s.log' % self.ticket))
    2732
    2833    def public_url(self):
     34        """Returns the public URL for this component"""
    2935        return '%s/%s' % (self.repo_url, self.component)
    3036
     
    3541
    3642    def local_url(self):
     43        """Returns the local URL for this component"""
    3744        return 'file://%s/%s' % (self.repo_dir, self.component)
    3845
     
    4855
    4956    def version_subdir(self):
     57        """Returns the subdirectory name for the version"""
    5058        if self.version == 'trunk':
    5159            subdir = 'trunk'
     
    5866        return subdir
    5967
     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.