Beispiel #1
0
 def activate_egg(self, egg_path):
     """ Create the EGG_INFO structure in a checkout
     """
     if 'setup.py' in os.listdir(egg_path):
         pythonpath = ':'.join(sys.path)
         cmd = 'PYTHONPATH="%s" %s %s/setup.py egg_info' % (
             pythonpath, sys.executable, egg_path)
         shell_cmd(cmd, fromwhere=egg_path)
    def _build_simple_rst(self, package_name, tag_name):
        """ Build HTML output from the setuptools long_description
        """
        rst = ''
        package_path = os.path.join(self.options.workingdir, package_name)
        tag_folder = os.path.join(package_path, tag_name)
        if os.path.isdir(tag_folder) and 'setup.py' in os.listdir(tag_folder):
            cmd = 'PYTHONPATH="%s" %s %s/setup.py --long-description' % (
                ':'.join(sys.path), sys.executable, tag_folder)
            rst = shell_cmd(cmd, fromwhere=tag_folder)

        if rst and rst != 'UNKNOWN':
            build_folder = os.path.join(tag_folder, '.docbuilder_html')
            shutil.rmtree(build_folder, ignore_errors=True)
            os.mkdir(build_folder)
            output_path = os.path.join(build_folder, 'index.html')
            settings = {}
            if os.path.isfile(self.options.fallback_css):
                settings = {'stylesheet_path': self.options.fallback_css}
            try:
                publish_file(source=StringIO(rst),
                             writer_name='html',
                             destination_path=output_path,
                             settings_overrides=settings)
                self.packages[package_name][tag_name] = build_folder
                msg = 'Building simple ReST docs for %s %s.'
                LOG.info(msg % (package_name, tag_name))
            except SystemMessage as e:
                msg = 'Building simple ReST doc for %s %s failed!'
                LOG.error(msg % (package_name, tag_name))
                LOG.error(str(e))
                pass
Beispiel #3
0
 def get_tag_names(self, url, checkout_path):
     """ Get all tag names from a repository URL
     """
     tags = []
     checkout_path = os.path.join(checkout_path, self.trunk_name)
     output = shell_cmd('git tag', fromwhere=checkout_path)
     if output:
         for line in output.split('\n'):
             tags.append(line.strip())
     return sorted(tags)
Beispiel #4
0
 def get_tag_names(self, url, checkout_path):
     """ Get all tag names from a repository URL
     """
     tags = []
     checkout_path = os.path.join(checkout_path, self.trunk_name)
     output = shell_cmd('hg tags', fromwhere=checkout_path)
     for line in output.split('\n'):
         tag, revision = line.split()
         if tag != 'tip':
             tags.append(tag)
     return sorted(tags)
Beispiel #5
0
 def get_tag_names(self, url, checkout_path):
     """ Get all tag names from a repository URL
     """
     cmd = 'svn ls %s/%s' % (url, self.tags_name)
     tag_names = [x.replace('/', '') for x in shell_cmd(cmd).split()]
     return sorted(tag_names)
Beispiel #6
0
 def checkout_tag(self, url, tag, checkout_path):
     """ Check out a specific tag
     """
     cmd = 'svn co %s/%s/%s %s' % (url, self.tags_name, tag, checkout_path)
     shell_cmd(cmd)
Beispiel #7
0
 def checkout(self, url, checkout_path):
     """ Check out from a repository
     """
     shell_cmd('svn co %s/%s %s' % (url, self.trunk_name, checkout_path))
Beispiel #8
0
 def update(self, checkout_path):
     """ Update an existing checkout
     """
     shell_cmd('svn up %s' % checkout_path)
Beispiel #9
0
 def checkout_tag(self, url, tag, checkout_path):
     """ Check out a specific tag
     """
     self.checkout(url, checkout_path)
     shell_cmd('git checkout %s' % tag, fromwhere=checkout_path)
Beispiel #10
0
 def checkout(self, url, checkout_path):
     """ Check out from a repository
     """
     shell_cmd('git clone %s %s' % (url, checkout_path))
Beispiel #11
0
 def update(self, checkout_path):
     """ Update an existing checkout
     """
     shell_cmd('git pull -a', fromwhere=checkout_path)
Beispiel #12
0
 def checkout_tag(self, url, tag, checkout_path):
     """ Check out a specific tag
     """
     shell_cmd('hg clone -r %s %s %s' % (tag, url, checkout_path))