コード例 #1
0
ファイル: migrate.py プロジェクト: kcpt/content-scripts
                      'migration of %s to %s\n', widgetDir, moduleDir)
            reposWithErrors[repo['path']] = True
            continue

        # SVN update & commit
        if reposWithErrors.get(repo['path'], False):
            log.warning('A previous migration in this script run modifying '
                'the project "%s" had errors. Skipping SVN commit so that the '
                'bad migration can be fixed. Please address errors and re-run '
                'the script or commit manually.', repo['path'])
        elif args.skip_commit:
            logging.info('Skipping SVN Commit. You must commit manually to '
                'save changes.')
        else:
            try:
                svn.cleanRepo(repo['path'])
                svn.commit(repo['path'], 'Migrating from %s non-modular widget '
                    'to modular widgets in %s using migrate.py' %(
                        widgetDir, moduleDir))
            except svn.SvnError as e:
                log.error(e.message)
                log.error('Unable to commit migration of %s to %s\n', widgetDir,
                          moduleDir)
        print '\n'

    # Report results
    if len(reposWithErrors):
        log.error('Some errors were encountered during this migration. See the '
            'logs for details.')

        uncommitedRepos = []
コード例 #2
0
ファイル: sync_styles.py プロジェクト: kcpt/content-scripts
                except subprocess.CalledProcessError as e:
                    log.error(e.message)
                    continue

        # Compile Sass.
        sassCommand = ['compass', 'compile', target['path']]

        if args.dry_run:
            print '"Compile Sass" with %s' % sassCommand
        else:
            try:
                log.info('Compiling Sass: %s', sassCommand)
                subprocess.check_call(sassCommand)
            except subprocess.CalledProcessError as e:
                log.error(e.message)
                log.error('Sass compilation error, skipping commit.')
                continue

        # Clean up svn status and commit.
        if args.dry_run:
            print '"Clean" SVN status for %s' % target['path']
            print '"SVN commit" for %s' % target['path']
        else:
            try:
                svn.cleanRepo(target['path'])
                svn.commit(target['path'], 'Syncing styles with sync_styles.py script.')
            except svn.SvnError as e:
                log.error(e.message)
                continue