예제 #1
0
def main():
    parser = OptionParser()

    parser.add_option("--log",
                      dest="log", default="-",
                      help="write log to FILE", metavar="FILE")

    parser.add_option("-l", "--list",
                      action="store_true", dest="list",
                      help="list groups and repositories")

    parser.add_option("-i", "--interactive",
                      action="store_true", dest="interactive",
                      help="prompt before actions")

    parser.add_option("-a", "--all",
                      action="store_true", dest="all",
                      help="Backup all repositories")

    parser.add_option("-q", "--quiet",
                      action="store_true", dest="quiet",
                      help="only log errors and warnings")

    parser.add_option("-c", "--config",
                      dest="config", default=core.CONFIG_FILE,
                      help="config file to use (default to %s)" % core.CONFIG_FILE)

    (options, args) = parser.parse_args()

    core.setup_logger(options.log, options.quiet)

    config = core.load_config(options.config)

    if options.list:
        do_list(config.groups.values())
        return 0

    if options.all:
        groups = config.groups.values()
    else:
        groups = core.get_group_list(config, args)

    if not groups:
        logging.error("Nothing to synchronize")
        return 1

    if options.interactive:
        ui = TextUserInterface()
    else:
        ui = SilentUserInterface()

    return ui.do_sync(groups)
예제 #2
0
from PyQt4 import QtGui
from pyqtauto.widgets import (TableItem, Table, DialogButtonBox, TableCheckBox,
                              ExceptionMessageBox)
from data import TableMap
from core import setup_logger
import logging

setup_logger()


class ScopeView(QtGui.QWidget):
    """
	Displays project workscope GUI.

	Attributes
	----------
	stage_le : QLineEdit
		Accepts the number of stages in a machine.

	btn : DialogButtonBox
		Clicked to serialize the updated data model.

	"""

    _SELECT_ALL_ROW_OFFSET = 1
    _STAGE_COLUMN_OFFSET = 1

    def __init__(self):
        super(ScopeView, self).__init__()
        self._main_layout = QtGui.QVBoxLayout(self)
        self._main_layout.setSpacing(20)