Exemple #1
0
 def __call__(self):
     scm.tested_for_scms(('svn', 'gitsvn', 'git'), '.')
     scm.require_package_root_cwd()
     self.check_conditions()
     package_name = scm.get_package_name('.')
     if self.options.domain:
         domain = self.options.domain
     else:
         domain = package_name
     package_root = scm.get_package_root_path('.')
     package_dir = os.path.join(package_root, *package_name.split('.'))
     pot_path = os.path.join(self.locales_dir, '%s.pot' % domain)
     output.part_title('Rebuilding pot file at %s' % pot_path)
     # rebuild
     cmd = ['%s rebuild-pot' % self.i18ndude]
     cmd.append('--pot %s' % pot_path)
     # manual file
     manual_file = os.path.join(self.locales_dir, '%s-manual.pot' % domain)
     if os.path.exists(manual_file):
         print '  merging manual pot file:', manual_file
         cmd.append('--merge %s' % manual_file)
     cmd.append('--create %s %s' % (
             domain,
             package_dir,
             ))
     cmd = ' \\\n'.join(cmd)
     runcmd(cmd)
Exemple #2
0
 def __call__(self):
     scm.tested_for_scms(('svn', 'gitsvn'), '.')
     svn_url = scm.get_svn_url('.').split('/')
     svn_root_url = scm.get_package_root_url('.').split('/')
     package_name = scm.get_package_name('.')
     path = os.path.abspath(os.path.join(
             (len(svn_url) - len(svn_root_url) - 1) * '../',
             package_name.replace('.', '/'),
             'version.txt',
             ))
     if not os.path.isfile(path):
         output.error('Could not find file %s' % path, exit=1)
     version = open(path).read().strip()
     print '  Version of %s: %s' % (
         output.colorize(package_name, output.WARNING),
         output.colorize(version, output.WARNING),
         )
Exemple #3
0
 def __call__(self):
     scm.tested_for_scms(('svn', 'gitsvn', 'git'), '.')
     self.check_doc()
     self.analyse()
     if self.options.release_egg:
         self.check_pyprc()
     if not self.options.release_egg_only:
         self.check_versions()
     print ''
     input.prompt('Are you sure to continue? [OK]')
     self.build_mo_files()
     self.pre_build_check()
     if not self.options.release_egg_only:
         self.bump_version_before_tagging()
         self.create_tag()
     if self.options.release_egg:
         self.release_egg()
     if not self.options.release_egg_only:
         self.bump_version_after_tagging()
Exemple #4
0
 def __call__(self):
     scm.tested_for_scms(('svn', 'gitsvn', 'git'), '.')
     scm.require_package_root_cwd()
     if len(self.args) < 1:
         output.error('Language code is required', exit=1)
     lang = self.args[0]
     # check
     self.check_conditions()
     package_name = scm.get_package_name('.')
     if self.options.domain:
         domain = self.options.domain
     else:
         domain = package_name
     # check pot file
     pot_path = os.path.join(self.locales_dir, '%s.pot' % domain)
     if not os.path.exists(pot_path):
         output.error('Could not find pot file at: %s' % pot_path, exit=1)
     # check language directory
     lang_dir = os.path.join(self.locales_dir, lang, 'LC_MESSAGES')
     if not os.path.isdir(lang_dir):
         runcmd('mkdir -p %s' % lang_dir)
     # touch po file
     po_file = os.path.join(lang_dir, '%s.po' % domain)
     if not os.path.isfile(po_file):
         runcmd('touch %s' % po_file)
     # sync
     output.part_title('Syncing language "%s"' % lang)
     cmd = '%s sync --pot %s %s' % (
         self.i18ndude,
         pot_path,
         po_file,
         )
     runcmd(cmd)
     # remove language
     output.part_title('Removing language code from po file')
     data = open(po_file).read().split('\n')
     file = open(po_file, 'w')
     for row in data:
         if not row.startswith('"Language-Code') and \
                 not row.startswith('"Language-Name'):
             file.write(row)
             file.write('\n')
     file.close()
Exemple #5
0
    def __call__(self):
        """Run the checks
        """
        scm.tested_for_scms(('svn', 'gitsvn', 'git'), '.')
        if not os.path.exists('setup.py'):
            raise Exception('Could not find setup.py')
        if scm.has_local_changes('.'):
            output.error('You have local changes, please commit them first.',
                         exit=True)

        self.checks = []

        all_checks = []
        # get all checks from parser
        for option in self.parser.option_list:
            # get all options with a dest= starting with check_
            if option.dest and option.dest.startswith('check_'):
                opt_value = getattr(self.options, option.dest)
                short_name = option.dest[len('check_'):]
                if opt_value:
                    self.checks.append(short_name)
                all_checks.append(short_name)

        # if there are no checks activated by parementer, activate all
        if not len(self.checks):
            self.checks = all_checks

        # run the checks
        if 'setup' in self.checks:
            self.check_setup_py()
        if 'paster' in self.checks:
            self.check_paster_stuff()
        if 'description' in self.checks:
            self.check_description()
        if 'requires' in self.checks:
            self.check_requires()
        if 'zcml' in self.checks:
            self.check_zcml()
Exemple #6
0
 def __call__(self):
     scm.tested_for_scms(('svn', 'gitsvn'), '.')
     package_name = scm.get_package_name('.')
     sys.argv = [sys.argv[0], 'zopeinstance', 'test', '-s', package_name]
     zopeinstance.ZopeInstanceCommand(self.maincommand)()