def __init__(self): apiUtils.synthesize(self, 'commands', None) apiUtils.synthesize(self, 'parser', None) self._setupLogging() self._setupParser() self._setupCommands()
def onFinalize(self, msg='Choose', choices=[]): apiUtils.synthesize(self, 'msg', msg) apiUtils.synthesize(self, 'submitted', False) self.setModal(True) self.ui_message.setText(self.msg) self.ui_submit.clicked.connect(self.emitChoiceSubmitted) for choice in choices: self.ui_choices.addItem(choice) self.center()
def onFinalize(self, msg='Choose', choices=[]): apiUtils.synthesize(self, 'msg', msg) apiUtils.synthesize(self, 'submitted', False) self.setModal(True) self.ui_message.setText(self.msg) self.ui_submit.clicked.connect(self.emitChoiceSubmitted) for choice in choices : self.ui_choices.addItem(choice) self.center()
def onFinalize(self, pickerType=None, ext='', label='', field=''): apiUtils.synthesize(self, 'pickerType', PathWidget.pickerTypes.File) self.setPickerType(pickerType) apiUtils.synthesize(self, 'ext', ext) self.setLabel(label) self.setField(field) self.ui_Field.contextMenuEvent = self.extendContextMenuEvent self.actionShow_in_explorer.triggered.connect(self.openPath) self.ui_Picker.clicked.connect(self.pickFile) self.ui_Field.textChanged.connect(self.emitPathChanged) self.ui_Field.editingFinished.connect(self.editingFinished)
def __init__(self, address=None, port=None): self.socket = socket.socket(self.ADDRESS_FAMILY, self.SOCKET_TYPE) self.conn = self.socket apiUtils.synthesize(self, 'timeout', None) apiUtils.synthesize(self, 'address', address or getLocalIP(), True) apiUtils.synthesize(self, 'port', port or self.DEFAULT_PORT, True) apiUtils.synthesize(self, 'networkAddress', (self.address, self.port), True)
def __init__(self, model=None, proxyModel=None, editors={}, *args, **kwds): self._qtclass = QtGui.QWidget apiUtils.synthesize(self, 'model', model) apiUtils.synthesize(self, 'proxyModel', proxyModel) apiUtils.synthesize(self, 'editors', editors) apiUtils.synthesize(self, 'busy', False) BaseGUI.__init__(self, **kwds) if proxyModel : self.setProxyModel(proxyModel) elif model : self.setModel(model)
def __init__(self, model=None, proxyModel=None, editors={}, *args, **kwds): self._qtclass = QtGui.QWidget apiUtils.synthesize(self, 'model', model) apiUtils.synthesize(self, 'proxyModel', proxyModel) apiUtils.synthesize(self, 'editors', editors) apiUtils.synthesize(self, 'busy', False) BaseGUI.__init__(self, **kwds) if proxyModel: self.setProxyModel(proxyModel) elif model: self.setModel(model)
def __init__(self, appKey, appSecret, appAccessType): apiUtils.synthesize(self, "appKey", appKey) apiUtils.synthesize(self, "appSecret", appSecret) apiUtils.synthesize(self, "appAccessType", appAccessType) self._tokenPath = apiUtils.getTempPath().join(self.appKey() + '_token') self._accessKey = '' self._accessSecret = ''
def __init__(self, model=None, proxyModel=None, **kwds): self._qtclass = QtGui.QWidget apiUtils.synthesize(self, 'model', model) apiUtils.synthesize(self, 'proxyModel', proxyModel) apiUtils.synthesize(self, 'dataMapper', QtGui.QDataWidgetMapper()) #self._dataMapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit) BaseGUI.__init__(self, **kwds)
def onFinalize(self, total=1, current=0, message='Loading...'): apiUtils.synthesize(self, 'total', total) apiUtils.synthesize(self, 'current', current) apiUtils.synthesize(self, 'message', message) self.ui_ProgressBar.setValue(1) self.ui_Label.setText(self.message) self.center() self.show() self.update()
def __init__(self, parent=None, *args, **kwds): super(BaseData, self).__init__() apiUtils.synthesize(self, 'parent', parent) apiUtils.synthesize(self, 'children', []) apiUtils.synthesize(self, 'columnMap', []) if parent is not None: parent.addChild(self) if args or kwds : raise Exception('Unhandled Args:\n{0}\n{1}'.format(str(args), str(kwds)))
def __init__(self): self.setupLogging() apiUtils.synthesize(self, 'environment', Core.EnvironmentTypes.External) apiUtils.synthesize(self, 'mfcApp', False) apiUtils.synthesize(self, 'app', None) app = Core.getQTApp() self.setApp(app) self._readSettings() self.app.aboutToQuit.connect(self._saveSettings)
def __init__(self, parent=None, *args, **kwds): super(BaseData, self).__init__() apiUtils.synthesize(self, 'parent', parent) apiUtils.synthesize(self, 'children', []) apiUtils.synthesize(self, 'columnMap', []) if parent is not None: parent.addChild(self) if args or kwds: raise Exception('Unhandled Args:\n{0}\n{1}'.format( str(args), str(kwds)))
def onFinalize(self, loginMsg='Login', credentialsFile=''): apiUtils.synthesize(self, 'loginMsg', loginMsg) apiUtils.synthesize(self, 'credentialsFile', Path(credentialsFile)) apiUtils.synthesize(self, 'submitted', False) self.setModal(True) self.ui_loginMessage.setText(self.loginMsg) self.ui_submit.clicked.connect(self.emitLoginSubmitted) self.ui_username.returnPressed.connect(self.emitLoginSubmitted) self.ui_password.returnPressed.connect(self.emitLoginSubmitted) self.ui_password.setEchoMode(QtGui.QLineEdit.Password) self.center() if self.credentialsFile: self._readCredentials()
def onFinalize(self, loginMsg='Login', credentialsFile=''): apiUtils.synthesize(self, 'loginMsg', loginMsg) apiUtils.synthesize(self, 'credentialsFile', Path(credentialsFile)) apiUtils.synthesize(self, 'submitted', False) self.setModal(True) self.ui_loginMessage.setText(self.loginMsg) self.ui_submit.clicked.connect(self.emitLoginSubmitted) self.ui_username.returnPressed.connect(self.emitLoginSubmitted) self.ui_password.returnPressed.connect(self.emitLoginSubmitted) self.ui_password.setEchoMode(QtGui.QLineEdit.Password) self.center() if self.credentialsFile : self._readCredentials()
def __init__(self): apiUtils.synthesize(self, "helpFlag", True) apiUtils.synthesize(self, "args", '') apiUtils.synthesize(self, "parentParser", '') apiUtils.synthesize(self, "parser", '')
def __init__(self, username=None, password=None, client=None, port=None, verbose=False): apiUtils.synthesize(self, 'p4Conn', None) apiUtils.synthesize(self, 'p4Info', {}) apiUtils.synthesize(self, 'verbose', verbose) apiUtils.synthesize(self, 'p4User', username or os.getenv('P4USER')) apiUtils.synthesize(self, 'p4Password', password or os.getenv('P4PASSWD')) apiUtils.synthesize(self, 'p4Client', client or os.getenv('P4CLIENT')) apiUtils.synthesize(self, 'p4Port', port or os.getenv('P4PORT')) self._connect()
def __init__(self, parent=None, overrideStdOut=False, overrideStdErr=False): super(LoggingWidget, self).__init__(parent) # set standard properties self.setReadOnly(True) self.setLineWrapMode(LoggingWidget.NoWrap) # setup the sys.stdout iterceptor handler = LoggingWidgetHandler(self) logger = logging.getLogger(apiUtils.getClassName(self)) logger.setLevel(logging.DEBUG) logger.addHandler(handler) if overrideStdOut : loggerStdOut = SysStreamLogger(logger, logging.INFO) sys.stdout = loggerStdOut apiUtils.synthesize(self, 'loggerStdOut', loggerStdOut) if overrideStdErr : loggerStdErr = SysStreamLogger(logger, logging.ERROR) sys.stderr = loggerStdErr apiUtils.synthesize(self, 'loggerStdErr', loggerStdErr) # define custom properties apiUtils.synthesize(self, 'logger', logger) apiUtils.synthesize(self, 'clearOnClose', True) apiUtils.synthesize(self, 'handler', handler) apiUtils.synthesize(self, 'currentMode', 'standard') apiUtils.synthesize(self, 'blankCache', '') apiUtils.synthesize(self, 'mutex', QtCore.QMutex()) # determine whether or not to use the light or dark configuration palette = self.palette() base = palette.color(palette.Base) avg = (base.red() + base.green() + base.blue()) / 3.0 if ( avg < 160 ): colorSet = LoggingColorSet.darkScheme() else: colorSet = LoggingColorSet.lightScheme() apiUtils.synthesize(self, 'colorSet', colorSet) palette.setColor(palette.Text, colorSet.color('Standard')) palette.setColor(palette.Base, colorSet.color('Background')) self.setPalette(palette) # setup the levels self._loggingEnabled = { 'debug': True, 'info': True, 'warning': True, 'error': True, 'critical': True, 'fatal': True, } # create connections self.pythonMessageLogged.connect(self.log)
def __init__(self, logger, log_level=logging.INFO): apiUtils.synthesize(self, 'logger', logger) apiUtils.synthesize(self, 'logLevel', log_level)
def __init__(self, default=None, name=None, required=False, choices=None): apiUtils.synthesize(self, 'default', default) apiUtils.synthesize(self, 'name', name) apiUtils.synthesize(self, 'required', required) apiUtils.synthesize(self, 'choices', choices)
def deserialize(self, obj='', hilite=False, compData={}, vtxFaceColorData={}): apiUtils.synthesize(self, 'object', obj) apiUtils.synthesize(self, 'hilite', hilite) apiUtils.synthesize(self, 'vtxFaceColorData', vtxFaceColorData) if compData: self._set_data(data_dict=compData)
def __init__(self, daemon=True, **kwds): threading.Thread.__init__(self, **kwds) Process.__init__(self) apiUtils.synthesize(self, 'threadLock', threading.Lock()) self.setDaemon(daemon)
def deserialize(self, datadict={}, filepath=''): apiUtils.synthesize(self, 'filepath', Path(filepath)) self.read() self._set_data(datadict=datadict)
def __init__(self, *args, **kwds): super(Document, self).__init__(*args, **kwds) apiUtils.synthesize(self, 'encoder', None)
def __init__(self): apiUtils.synthesize(self, 'isMainloopAlive', False) apiUtils.synthesize(self, 'isPromptloopAlive', False)
def __init__( self, widget, showLevel=False, showDetails=False ): logging.Handler.__init__(self) apiUtils.synthesize(self, 'widget', weakref.ref(widget)) apiUtils.synthesize(self, 'showLevel', showLevel) apiUtils.synthesize(self, 'showDetails', showDetails) apiUtils.synthesize(self, 'formatter', logging.Formatter())
def __init__(self, *args, **kwds): super(Document, self).__init__( *args, **kwds) apiUtils.synthesize(self, 'encoder', None)