Exemple #1
0
    def __init__(self):
        signal.signal(signal.SIGINT, self.signal_handler)
        self.logger = logging.getLogger("SyncCFT 1.0")
        self.logger.info("Starting SyncCFT 1.0 at %s" % (str(time.time())))
        self.exit_flag = 0

        config = Configuration(sys.argv)

        conf_values = config.load_configuration()
        self.local_password = config.load_password()

        if not conf_values:
            self.logger.error("An error occurred while loading the configuration!")
            return

        (self.port, self.folder, self.p_prob, self.q_prob, self.peers) = conf_values
        #Logging of configuration
        self.logger.info("Listening on UDP port %s" % (str(self.port)))
        self.logger.info("Synchronizing folder %s" % (str(self.folder)))
        self.logger.info("'p' parameter: %s" % (str(self.p_prob)))
        self.logger.info("'q' parameter: %s" % (str(self.q_prob)))

        i=1
        for item in self.peers:
            self.logger.info("Peer %d: %s:%s" % (i,str(item[0]),str(item[1])))
            i+=1
Exemple #2
0
    def showBorder(self):
        # # # print " SHOW BORDERS self.parentWidget.borderAct.isEnabled()=",self.parentWidget.borderAct.isEnabled()
        Configuration.setSetting("CellBordersOn",True)
#        print MODULENAME,' showBorder ============'
        if not self.currentActors.has_key("BorderActor"):
            self.currentActors["BorderActor"]=self.borderActor  
            self.graphicsFrameWidget.ren.AddActor(self.borderActor)
class GestorAccesos:

	## Constructor de la clase
	#
	# En la clase constructora se realiza, en el siguiente orden:
	# \li Carga de la configuracion y obtencion de los parametros de la base de datos de este
	# \li Invocacion al objeto DbDriver con la informacion de la configuracion obtenida previamente
	# \li Invocacion de la ventana principal
	# La ventana principal ejecuta los metodos del objeto DbDriver instanciado en esta clase para realizar todas las consultas
	def __init__(self):
		locale.setlocale(locale.LC_ALL, '')
		gettext.bindtextdomain("GestorAccesos", ".")
		gettext.textdomain("GestorAccesos")
		_ = gettext.gettext

		self.appConfig = Configuration("resources/prueba.xml")
		self.appConfig.getDbConfiguration()
		self.dbDriver = DbDriver(self.appConfig.dbType, self.appConfig.dbParams)

		mgui = MainWindow(self)
		mgui.window.show()
		gtk.main()

	## Funcion para la salida de la aplicacion
	#
	# Funcion para la salida de la aplicacion.
	def quit(self):
		gtk.main_quit()
def parse_opts():
    """Parses command line options"""

    usage = "Usage: %prog [options]"
    parser = optparse.OptionParser(usage)
    parser.add_option("-c", "--config", dest="config", type="string",
                      help="report configuration file (required)")
    parser.add_option("-v", "--verbose",
                      action="store_true", dest="verbose", default=False,
                      help="print debug messages to stdout")
    parser.add_option("-E", "--experiement",
                      dest="vo", type="string",
                      help="experiment name")
    parser.add_option("-T", "--template",
                      dest="template", type="string",
                      help="template_file")
    parser.add_option("-s", "--start", type="string",
                      dest="start", help="report start date YYYY/MM/DD HH:MM:DD (required)")
    parser.add_option("-e", "--end", type="string",
                      dest="end", help="report end date YYYY/MM/DD")
    parser.add_option("-d", "--dryrun", action="store_true", dest="is_test", default=False,
                      help="send emails only to _testers")

    options, arguments = parser.parse_args()
    Configuration.checkRequiredArguments(options, parser)
    return options, arguments
    def readVisualSets(self):
        # visualDefaults
        self._cellBordersOn    = Configuration.getSetting("CellBordersOn")
        self._clusterBordersOn    = Configuration.getSetting("ClusterBordersOn")      
#        print MODULENAME,'   readVisualSets():  cellBordersOn, clusterBordersOn = ',self._cellBordersOn, self._clusterBordersOn 
        self._conLimitsOn  = Configuration.getSetting("ConcentrationLimitsOn")
        self._zoomFactor   = Configuration.getSetting("ZoomFactor")
Exemple #6
0
 def hideClusterBorder(self):
     Configuration.setSetting("ClusterBordersOn",False)
     if self.currentActors.has_key("ClusterBorderActor"):
         del self.currentActors["ClusterBorderActor"] 
         self.graphicsFrameWidget.ren.RemoveActor(self.clusterBorderActor)
     self.Render()
     self.graphicsFrameWidget.repaint()
 def readColorsSets(self):
     #colorsDefaults
     self._colorMap     = Configuration.getSetting("TypeColorMap")
     self._borderColor  = Configuration.getSetting("BorderColor")
     self._contourColor = Configuration.getSetting("ContourColor")
     self._brushColor   = Configuration.getSetting("BrushColor")
     self._penColor     = Configuration.getSetting("PenColor")
Exemple #8
0
def main(argv=None):
    """main can also be called in the python interpreter, by supplying the command line as the argument."""
    if argv is None:
        argv = sys.argv[1:]

    def destroy(*args):  # call back for terminating the main eventloop
        gtk.main_quit()

    Configuration.set_logfile("fpdb-log.txt")
    import Options

    (options, argv) = Options.fpdb_options()

    if options.usage == True:
        #Print usage examples and exit
        sys.exit(0)

    if options.sitename:
        options.sitename = Options.site_alias(options.sitename)
        if options.sitename == False:
            usage()

    config = Configuration.Config(file = "HUD_config.test.xml")
    db = Database.Database(config)
    sql = SQL.Sql(db_server = 'sqlite')

    main_window = gtk.Window()
    main_window.connect('destroy', destroy)

    replayer = GuiReplayer(config, sql, main_window, options=options, debug=True)

    main_window.add(replayer.get_vbox())
    main_window.set_default_size(800,800)
    main_window.show()
    gtk.main()
Exemple #9
0
def main(argv=None):
    if argv is None:
        argv = sys.argv[1:]

    Configuration.set_logfile("fpdb-log.txt")
    config = Configuration.Config(file = "HUD_config.test.xml")
    in_path = os.path.abspath('regression-test-files')
    IdSite = IdentifySite(config)
    start = time()
    IdSite.scan(in_path)
    print 'duration', time() - start

    print "\n----------- SITE LIST -----------"
    for sid, site in IdSite.sitelist.iteritems():
        print "%2d: Name: %s HHC: %s Summary: %s" %(sid, site.name, site.filter_name, site.summary)
    print "----------- END SITE LIST -----------"

    print "\n----------- ID REGRESSION FILES -----------"
    count = 0
    for f, ffile in IdSite.filelist.iteritems():
        tmp = ""
        tmp += ": Type: %s " % ffile.ftype
        count += 1
        if ffile.ftype == "hh":
            tmp += "Conv: %s" % ffile.site.hhc_fname
        elif ffile.ftype == "summary":
            tmp += "Conv: %s" % ffile.site.summary
        print f, tmp
    print count, 'files identified'
    print "----------- END ID REGRESSION FILES -----------"

    print "----------- RETRIEVE FOR SINGLE SITE -----------"
    IdSite.getFilesForSite("PokerStars", "hh")
    print "----------- END RETRIEVE FOR SINGLE SITE -----------"
def main():
  ########################
  #GENERAL CONFIGURATION #
  ########################
  #load config
  config=Configuration.general_configuration();
  #get sensor parameters
  obstructionSensorFront = Configuration.CONFIG['ObstructionSensors']['FRONT']  

  ###############
  #SETUP LOGGING#
  ###############
  LOGGER = 'ObstructionSensor'
  #load logging configuration
  Configuration.logging_configuration();
  #configure logger as per configuration
  Configuration.init_log(LOGGER);
  #create logger
  logger =  logging.getLogger(LOGGER) 

  #go start application server
  mySensor = ObstructionSensor(logger=logger, obstructionSensorFront=int(obstructionSensorFront))
  
  while True:
    logger.debug('mySensor.obstructed['+str(mySensor.obstructed)+']')
    time.sleep(.5)
  return 0
def main():
    Configuration.set_logfile("fpdb-log.txt")
    config = Configuration.Config()
    db = Database.Database(config)

    tourney_ids = db.getSiteTourneyNos("Merge")
    tids = []

    for tid in tourney_ids:
        blah, = tid # Unpack tuple
        tids.append(str(blah))
    #    winamax_get_winning(tid,"blah")
    results_dir = config.get_import_parameters().get("ResultsDirectory")
    results_dir = os.path.expanduser(results_dir)
    site_dir = os.path.join(results_dir, "Merge")
    print "DEBUG: site_dir: %s" % site_dir
    filelist = [file for file in os.listdir(site_dir) if not file in [".",".."]]
    print "DEBUG: filelist : %s" % filelist
    print "DEBUG: tids     : %s" % tids

    for f in filelist:
        try:
            tids.remove(f)
        except ValueError:
            print "Warning: '%s' is not a known tourney_id" % f

    if len(tids) == 0:
        print "No tourney results files to fetch"
    else:
        for tid in tids:
            filename = os.path.join(site_dir, tid)
            data = fetch_results_page(tid)
            if data != None:
                print u"DEBUG: write_file(%s)" %(filename)
                write_file(filename, data)
    def store_gui_vis_config(self, scr_data):
        """
        Stores visualization settings such as cell borders, on/or cell on/off etc...

        :param scr_data: {instance of ScreenshotDescriptionData}
        :return: None
        """
        tvw = self.parentWidget()

        scr_data.cell_borders_on = tvw.borderAct.isChecked()
        scr_data.cells_on = tvw.cellsAct.isChecked()
        scr_data.cluster_borders_on = tvw.clusterBorderAct.isChecked()
        scr_data.cell_glyphs_on = tvw.cellGlyphsAct.isChecked()
        scr_data.fpp_links_on = tvw.FPPLinksAct.isChecked()
        scr_data.lattice_axes_on = Configuration.getSetting('ShowHorizontalAxesLabels') or Configuration.getSetting(
            'ShowVerticalAxesLabels')
        scr_data.lattice_axes_labels_on = Configuration.getSetting("ShowAxes")
        scr_data.bounding_box_on = Configuration.getSetting("BoundingBoxOn")

        invisible_types = Configuration.getSetting("Types3DInvisible")
        invisible_types = invisible_types.strip()

        if invisible_types:
            scr_data.invisible_types = list(map(lambda x: int(x), invisible_types.split(',')))
        else:
            scr_data.invisible_types = []
Exemple #13
0
def main(argv=None):
    if argv is None:
        argv = sys.argv[1:]

    (options, argv) = Options.fpdb_options()

    if options.usage == True:
        # Print usage examples and exit
        print _("USAGE:")
        sys.exit(0)

    if options.hhc == "PokerStarsToFpdb":
        print _("Need to define a converter")
        exit(0)

    Configuration.set_logfile("fpdb-log.txt")
    # These options should really come from the OptionsParser
    config = Configuration.Config()
    db = Database.Database(config)
    sql = SQL.Sql(db_server="sqlite")
    settings = {}
    settings.update(config.get_db_parameters())
    settings.update(config.get_import_parameters())
    settings.update(config.get_default_paths())
    db.recreate_tables()

    runFake(db, config, options)
    def get_min_max_metadata(self, scene_metadata, field_name):
        """
        Returns dictionary with the following entries:
        1. MinRangeFixed
        2. MaxRangeFixed
        3. MinRange
        3. MaxRange

        :param scene_metadata:{dict} metadata dictionary
        :param field_name: {str} field name
        :return: {dict}
        """
        out_dict = {}
        if set(['MinRangeFixed', "MaxRangeFixed", 'MinRange', 'MaxRange']).issubset(set(scene_metadata.keys())):

            min_range_fixed = scene_metadata['MinRangeFixed']
            max_range_fixed = scene_metadata['MaxRangeFixed']
            min_range = scene_metadata['MinRange']
            max_range = scene_metadata['MaxRange']
        else:
            min_range_fixed = Configuration.getSetting("MinRangeFixed", field_name)
            max_range_fixed = Configuration.getSetting("MaxRangeFixed", field_name)
            min_range = Configuration.getSetting("MinRange", field_name)
            max_range = Configuration.getSetting("MaxRange", field_name)

        out_dict['MinRangeFixed'] = min_range_fixed
        out_dict['MaxRangeFixed'] = max_range_fixed
        out_dict['MinRange'] = min_range
        out_dict['MaxRange'] = max_range

        return out_dict
Exemple #15
0
    def drawVectorFieldData(self,bsd,fieldType,_fillVectorFieldFcn):        
        self.drawModel.initVectorFieldCellLevelActors(_fillVectorFieldFcn, (self.glyphsActor,))
        
        if Configuration.getSetting("OverlayVectorsOn",self.currentDrawingParameters.fieldName):
            self.drawCellField(bsd, fieldType)
        else:
            self.hideCells()
        
        if not self.currentActors.has_key("Glyphs2DActor"):
            self.currentActors["Glyphs2DActor"]=self.glyphsActor  
            self.graphicsFrameWidget.ren.AddActor(self.glyphsActor)         

        fieldName = self.currentDrawingParameters.fieldName
#        print MODULENAME, '------ drawVectorFieldData:   fieldName =',fieldName
        legendEnabled = Configuration.getSetting("LegendEnable",fieldName)
#        print MODULENAME, '------ drawVectorFieldData:   legendEnabled =',legendEnabled
#        foorwh=1/0
        if legendEnabled:
            self.drawModel.prepareLegendActors((self.drawModel.glyphsMapper,),(self.legendActor,))
            self.showLegend(True)
        else:
            self.showLegend(False)
            
        if self.parentWidget.borderAct.isChecked():
            self.drawBorders2D()         
        else:
            self.hideBorder()

        self.drawModel.prepareOutlineActors((self.outlineActor,))        
        self.showOutlineActor()
            
        self.Render()
    def get_config_metadata(self, field_name, field_type):
        """
        Returns dictionary of auxiliary information needed to render borders
        :param field_name:{str} field_name
        :param field_type: {str} field type
        :return: {dict}
        """
        metadata_dict = {}
        metadata_dict['BorderColor'] = qcolor_to_rgba(Configuration.getSetting('BorderColor'))
        metadata_dict['ClusterBorderColor'] = qcolor_to_rgba(Configuration.getSetting('ClusterBorderColor'))
        metadata_dict['BoundingBoxColor'] = qcolor_to_rgba(Configuration.getSetting('BoundingBoxColor'))
        metadata_dict['AxesColor'] = qcolor_to_rgba(Configuration.getSetting('AxesColor'))
        metadata_dict['ContourColor'] = qcolor_to_rgba(Configuration.getSetting('ContourColor'))
        metadata_dict['WindowColor'] = qcolor_to_rgba(Configuration.getSetting('WindowColor'))
        # todo - fix color of fpp links
        metadata_dict['FPPLinksColor'] = qcolor_to_rgba(Configuration.getSetting('FPPLinksColor'))

        metadata_dict['ShowHorizontalAxesLabels'] = Configuration.getSetting('ShowHorizontalAxesLabels')
        metadata_dict['ShowVerticalAxesLabels'] = Configuration.getSetting('ShowVerticalAxesLabels')

        # type-color map
        type_color_map_dict = OrderedDict()
        config_type_color_map = Configuration.getSetting("TypeColorMap")
        for type_id, qt_color in config_type_color_map.items():
            type_color_map_dict[type_id] = qcolor_to_rgba(qt_color)

        metadata_dict['TypeColorMap'] = type_color_map_dict


        return metadata_dict
	def newConfiguration(self, formdata):
		cherrypy.response.headers['Content-Type'] = 'application/json'
		
		formdata = cjson.decode(formdata)
		print formdata
		
		error = ""
		
		if self.configurations.has_key(formdata["configname"]) == False:
			if formdata["port"] != "":
				if self.checkFreePorts(formdata["protocol"], formdata["port"]):
					formdata["manport"] = self.getFreePorts(formdata["configname"])[1]
				else:
					result = False
					error = "port is occupied"
					return cjson.encode({"result": result, "error": error})
			else:
				freeport = self.getFreePorts(formdata["configname"])
				formdata["port"] = freeport[0]
				formdata["manport"] = freeport[1]
			
			newConf = Configuration(0, formdata["configname"], "")
			newConf.new(formdata)
			
			self.configurations[newConf.id] = copy(newConf)
			self.setConfiguration(newConf.id)
			result = True
		else:
			result = False
			error = "name exists"
		
		self.loadConfigurations()
		
		return cjson.encode({"result": result, "error": error})
Exemple #18
0
def HistogramWeighted(data,bins,weights,sidx=None,no_copy = False):
    bins = np.ascontiguousarray(bins,dtype = data.dtype)
    bincounts = np.ascontiguousarray(np.zeros(bins.shape[0] -1,dtype = np.float64))
    if no_copy:
        data = np.ravel(data)
        weights = np.ravel(weights)
    else:
        data = np.ravel(data.copy())
        weights = np.ravel(weights)

    if sidx is None:
        sidx = argsort(data,no_copy=True)
    data = np.ascontiguousarray(data[sidx])
    weights = np.ascontiguousarray(weights[sidx],dtype=data.dtype)

    codefile = open(loompath+"/csrc/inline_histogram_weighted.cc","r")
    code = codefile.read().format(FLOAT = c_spec.num_to_c_types[data.dtype.char])
    codefile.close()

    auxcodefile = open(loompath+"/csrc/weighted_histogram_aux.cc","r")
    auxcode = auxcodefile.read().format(FLOAT = c_spec.num_to_c_types[data.dtype.char])
    auxcodefile.close()

    Configuration.weave(code,
            ["bins","data","weights","bincounts"],
            locals(),
            support_code=auxcode)
    return bincounts, bins,sidx
    def showFPPLinks(self):
#        print '============  MVCDrawView3D.py:  showFPPLinks'
        Configuration.setSetting("FPPLinksOn",True)
        if not self.currentActors.has_key("FPPLinksActor"):
            self.currentActors["FPPLinksActor"]=self.FPPLinksActor  
#            print '============       MVCDrawView3D.py:  showFPPLinks, add FPPLinksActor'
            self.graphicsFrameWidget.ren.AddActor(self.FPPLinksActor)
Exemple #20
0
def download(item):
    try:
        url = item.url
        #copy an instance
        runtime_ydl_option = copy.copy(ydl_option)

        runtime_ydl_option['outtmpl'] = Configuration.getDownloadPath() + '/' + str(item.id) + '-%(id)s.%(ext)s'
        ydl = youtube_dl.YoutubeDL(runtime_ydl_option)

        #process = subprocess.check_output(['youtube-dl', "-o downloads/video/%(uploader)s/%(title)s-%(id)s.%(ext)s", url], stderr=subprocess.STDOUT,shell=True)
        logging.info('[%s] Start downloading [%s]. ', threading.currentThread().name, url)
        #info = ydl.extract_info(url=url, download=False)
        info = ydl.extract_info(url=url)
        # Reduce the json info by removing unused format information
        #info['formats'] = None

        logging.info('[%s] after extract info', threading.currentThread().name)

        jsonFileName = Configuration.getDownloadPath() + '/{0}-{1}.json'.format(str(item.id), info['id'])

        with open(jsonFileName, 'w') as f:
            json.dump(info, f, indent=1)

        logging.info("[%s] ******Downloading finished: [%s] - [%s]", threading.currentThread().name, info['title'], info['format'])
        time.sleep(3)

    # Handle Exception
    except Exception as e:
        logging.warn("[%s] Exception: %s.", threading.currentThread().name, e.message)
    else:
        DownloadInfoService.markAsDownloaded(url)
        logging.info('[%s] Downloaded successfully, mark [%s] to downloaded in DB.', threading.currentThread().name, url)
    def showCellGlyphs(self):
#        print MODULENAME,'  showCellGlyphs'
        Configuration.setSetting("CellGlyphsOn",True)
        if not self.currentActors.has_key("CellGlyphsActor"):
            self.currentActors["CellGlyphsActor"]=self.cellGlyphsActor  
#            print '  showCellGlyphs, add cellGlyphsActor'
            self.graphicsFrameWidget.ren.AddActor(self.cellGlyphsActor)
    def currentTabChanged(self):

        Configuration.setSetting("TabIndex", self.tabWidget.currentIndex())
        if (self.tabWidget.currentIndex() == 2):
#            print MODULENAME,' ------ currentTabChanged():  self.fieldComboBox.count() =',self.fieldComboBox.count() 
            if self.lastSelectedField >= 0: 
                self.fieldComboBox.setCurrentIndex(self.lastSelectedField)
    def set3DInvisibleTypes(self):
        '''
        Initializes a dictionary self.invisibleCellTypes of invisible cell types - reads settings "Types3DInvisible"
        :return:None
        '''
        self.colorMap = Configuration.getSetting("TypeColorMap")
        
        typesInvisibleStrTmp = str(Configuration.getSetting("Types3DInvisible"))
        # print "GOT ",typesInvisibleStrTmp
        if typesInvisibleStrTmp != self.typesInvisibleStr:
            self.typesInvisibleStr = str(Configuration.getSetting("Types3DInvisible"))
            
            import string
            typesInvisible = string.replace(self.typesInvisibleStr," ","")
            
            typesInvisible = string.split(typesInvisible,",")
            def cell_type_check(cell_type):
                try:
                    cell_type_int = int(cell_type)
                    if cell_type_int>=0:

                        return True
                    else:
                        return False
                except:
                    False

            typesInvisible = [int(cell_type) for cell_type in typesInvisible if cell_type_check(cell_type)]
            # print "typesInvisibleVec=",typesInvisibleVec
            #turning list into a dictionary
            self.invisibleCellTypes.clear()
            for type in typesInvisible:
                self.invisibleCellTypes[int(type)]=0        
    def add3DScreenshot(self, _plotName, _plotType, _camera, metadata=None):  # called from GraphicsFrameWidget
        if len(self.screenshotDataDict) > self.maxNumberOfScreenshots:
            print "MAX NUMBER OF SCREENSHOTS HAS BEEN REACHED"
        scrData = ScreenshotData()
        scrData.spaceDimension = "3D"
        scrData.plotData = (_plotName, _plotType)

        x_size = Configuration.getSetting("Screenshot_X")
        y_size = Configuration.getSetting("Screenshot_Y")

        (scrName, scrCoreName) = self.produceScreenshotName(scrData)

        okToAddScreenshot = True
        for name in self.screenshotDataDict:
            scrDataFromDict = self.screenshotDataDict[name]
            if scrDataFromDict.screenshotCoreName == scrCoreName and scrDataFromDict.spaceDimension == "3D":
                if scrDataFromDict.compareCameras(_camera):
                    print "CAMERAS ARE THE SAME"
                    okToAddScreenshot = False
                    break
                else:
                    print "CAMERAS ARE DIFFERENT"

        if (not scrName in self.screenshotDataDict) and okToAddScreenshot:
            scrData.screenshotName = scrName
            scrData.screenshotCoreName = scrCoreName
            scrData.screenshotGraphicsWidget = self.screenshotGraphicsWidget

            scrData.win_width = x_size
            scrData.win_height = y_size

            if metadata is not None:
                scrData.metadata = metadata

            tvw = self.tabViewWidget()
            if tvw:
                tvw.updateActiveWindowVisFlags(self.screenshotGraphicsWidget)

            self.store_gui_vis_config(scrData=scrData)

            scrData.extractCameraInfo(_camera)

            # on linux there is a problem with X-server/Qt/QVTK implementation and calling resize right after additional QVTK
            # is created causes segfault so possible "solution" is to do resize right before taking screenshot.
            # It causes flicker but does not cause segfault
            # User should NOT close or minimize this "empty" window (on Linux anyway).
            if sys.platform == 'Linux' or sys.platform == 'linux' or sys.platform == 'linux2':
                self.screenshotDataDict[scrData.screenshotName] = scrData
                self.screenshotCounter3D += 1
            else:
                self.screenshotDataDict[scrData.screenshotName] = scrData
                self.screenshotCounter3D += 1
        else:
            print "Screenshot ", scrCoreName, " with current camera settings already exists. " \
                                              "You need to rotate camera i.e. rotate picture " \
                                              "using mouse to take additional screenshot"

        # serializing all screenshots
        self.serialize_screenshot_data()
    def toggleModelEditor(self, flag):
        """
        Private slot to handle the toggle of the Model Editor window.
        """
        self.modelAct.setChecked(flag)

        Configuration.setSetting('DisplayModelEditor', flag)
        self.__toggleWindowFlag(self.modelEditorDock, flag)
 def initParams(self):  
     '''
         this fcn stores current settings for all the keys of Configuration.Configuration.defaultConfigs as a self.paramCC3D dictionary
     '''
     
     for key in Configuration.getSettingNameList():
         self.paramCC3D[key] = Configuration.getSetting(key)
     return    
 def on_default_settings_PB_clicked(self):
     ret = QMessageBox.question(self,'Restore Default Settings',
                                'Are you sure you want to revert settings to their default values',
                                QMessageBox.Ok|QMessageBox.Cancel,
                                QMessageBox.Cancel)
     if ret == QMessageBox.Cancel:
         return
     Configuration.reset_settings()
    def hideFPPLinks(self):
#        print '============  MVCDrawView3D.py:  hideFPPLinks'
        Configuration.setSetting("FPPLinksOn",False)
        if self.currentActors.has_key("FPPLinksActor"):
            del self.currentActors["FPPLinksActor"] 
#            print '============       MVCDrawView3D.py:  showFPPLinks, remove FPPLinksActor'
            self.graphicsFrameWidget.ren.RemoveActor(self.FPPLinksActor)
        self.Render()
        self.graphicsFrameWidget.repaint()
    def hideCellGlyphs(self):
#        print MODULENAME,'  hideCellGlyphs'
        Configuration.setSetting("CellGlyphsOn",False)
        if self.currentActors.has_key("CellGlyphsActor"):
            del self.currentActors["CellGlyphsActor"] 
#            print '  showCellGlyphs, remove cellGlyphsActor'
            self.graphicsFrameWidget.ren.RemoveActor(self.cellGlyphsActor)
        self.Render()
        self.graphicsFrameWidget.repaint()
    def toggleLatticeData(self, flag):
        """
        Private slot to handle the toggle of the Plugins window.
        """

        self.latticeDataAct.setChecked(flag)

        Configuration.setSetting('DisplayLatticeData', flag)
        self.__toggleWindowFlag(self.latticeDataDock, flag)
    def __init__(self, type=None, body=None, feed=None, local_vars_configuration=None):  # noqa: E501
        """CampaignEmailRssContentHtmlAllOf - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._type = None
        self._body = None
        self._feed = None
        self.discriminator = None

        if type is not None:
            self.type = type
        if body is not None:
            self.body = body
        if feed is not None:
            self.feed = feed
    def __init__(self, field_id=None, format=None, value=None, local_vars_configuration=None):  # noqa: E501
        """ContactExtraFieldNumber - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._field_id = None
        self._format = None
        self._value = None
        self.discriminator = None

        if field_id is not None:
            self.field_id = field_id
        if format is not None:
            self.format = format
        if value is not None:
            self.value = value
Exemple #33
0
    def __init__(self, date=None, action_name=None, action_data=None, local_vars_configuration=None):  # noqa: E501
        """ContactActivity - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._date = None
        self._action_name = None
        self._action_data = None
        self.discriminator = None

        if date is not None:
            self.date = date
        if action_name is not None:
            self.action_name = action_name
        if action_data is not None:
            self.action_data = action_data
Exemple #34
0
    def __init__(self, page_url=None, page_html=None, page_internal_name=None, local_vars_configuration=None):  # noqa: E501
        """SmartSmsCampaignPatchRequestPageContent - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._page_url = None
        self._page_html = None
        self._page_internal_name = None
        self.discriminator = None

        if page_url is not None:
            self.page_url = page_url
        if page_html is not None:
            self.page_html = page_html
        if page_internal_name is not None:
            self.page_internal_name = page_internal_name
Exemple #35
0
    def __init__(self, campaign_hash=None, overall=None, networks=None, local_vars_configuration=None):  # noqa: E501
        """PhoneReport - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._campaign_hash = None
        self._overall = None
        self._networks = None
        self.discriminator = None

        if campaign_hash is not None:
            self.campaign_hash = campaign_hash
        if overall is not None:
            self.overall = overall
        if networks is not None:
            self.networks = networks
Exemple #36
0
    def __init__(self, template_id=None, internal_name=None, custom=None, local_vars_configuration=None):  # noqa: E501
        """HeaderFooterTemplate - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._template_id = None
        self._internal_name = None
        self._custom = None
        self.discriminator = None

        if template_id is not None:
            self.template_id = template_id
        if internal_name is not None:
            self.internal_name = internal_name
        if custom is not None:
            self.custom = custom
Exemple #37
0
    def __init__(self, type=None, title=None, link=None, local_vars_configuration=None):  # noqa: E501
        """PushCampaignPostRequestActions - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._type = None
        self._title = None
        self._link = None
        self.discriminator = None

        if type is not None:
            self.type = type
        if title is not None:
            self.title = title
        if link is not None:
            self.link = link
    def __init__(self, email_status=None, cellphone_status=None, phone_status=None, local_vars_configuration=None):  # noqa: E501
        """ContactStatusFieldsSchema - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._email_status = None
        self._cellphone_status = None
        self._phone_status = None
        self.discriminator = None

        if email_status is not None:
            self.email_status = email_status
        if cellphone_status is not None:
            self.cellphone_status = cellphone_status
        if phone_status is not None:
            self.phone_status = phone_status
Exemple #39
0
    def __init__(self, id=None, header_links=None, footer_links=None, local_vars_configuration=None):  # noqa: E501
        """HeaderFooter - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._header_links = None
        self._footer_links = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if header_links is not None:
            self.header_links = header_links
        if footer_links is not None:
            self.footer_links = footer_links
Exemple #40
0
    def __init__(self, title=None, range=None, forms=None, callback_url=None, local_vars_configuration=None):  # noqa: E501
        """GenerateFormAnswersReport - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._title = None
        self._range = None
        self._forms = None
        self._callback_url = None
        self.discriminator = None

        self.title = title
        self.range = range
        self.forms = forms
        if callback_url is not None:
            self.callback_url = callback_url
Exemple #41
0
    def __init__(self, unique_field_in_use=None, field_id=None, contacts=None, local_vars_configuration=None):  # noqa: E501
        """UniqueFieldInUseErrors - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._unique_field_in_use = None
        self._field_id = None
        self._contacts = None
        self.discriminator = None

        if unique_field_in_use is not None:
            self.unique_field_in_use = unique_field_in_use
        if field_id is not None:
            self.field_id = field_id
        if contacts is not None:
            self.contacts = contacts
Exemple #42
0
    def get_local_compiler_path(self):
        if self.__local_compiler_path == None:

            keys_match = [("C_PATH", "compiler_path", "C_PATH")]

            command_line_match = []

            default_values = {"C_PATH": commands.getoutput("which cc")}

            config_file_path = "/etc/dms.cfg"

            # FIXME Catch the exception
            self.__local_compiler_path = Configuration.get_configuration(
                self.display_usage, self.check_values, keys_match,
                default_values, command_line_match, config_file_path,
                0)["C_PATH"]
        return self.__local_compiler_path
Exemple #43
0
    def __init__(self, site_id=None, internal_name=None, content=None, actions=None, local_vars_configuration=None):  # noqa: E501
        """WebPushCampaign - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._site_id = None
        self._internal_name = None
        self._content = None
        self._actions = None
        self.discriminator = None

        self.site_id = site_id
        self.internal_name = internal_name
        self.content = content
        if actions is not None:
            self.actions = actions
Exemple #44
0
    def __init__(self, base=None, extra=None, tags=None, local_vars_configuration=None):  # noqa: E501
        """Contact - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._base = None
        self._extra = None
        self._tags = None
        self.discriminator = None

        if base is not None:
            self.base = base
        if extra is not None:
            self.extra = extra
        if tags is not None:
            self.tags = tags
Exemple #45
0
    def __init__(self, body=None, plain_text=None, snippet=None, local_vars_configuration=None):  # noqa: E501
        """CampaignEmailContentHtmlPatch - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._body = None
        self._plain_text = None
        self._snippet = None
        self.discriminator = None

        if body is not None:
            self.body = body
        if plain_text is not None:
            self.plain_text = plain_text
        if snippet is not None:
            self.snippet = snippet
Exemple #46
0
    def __init__(self, webhook_id=None, list_id=None, url=None, actions=None, local_vars_configuration=None):  # noqa: E501
        """Webhook - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._webhook_id = None
        self._list_id = None
        self._url = None
        self._actions = None
        self.discriminator = None

        if webhook_id is not None:
            self.webhook_id = webhook_id
        self.list_id = list_id
        self.url = url
        self.actions = actions
Exemple #47
0
    def __init__(self, segment_id=None, name=None, type=None, local_vars_configuration=None):  # noqa: E501
        """AbstractSegment - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._segment_id = None
        self._name = None
        self._type = None
        self.discriminator = None

        if segment_id is not None:
            self.segment_id = segment_id
        if name is not None:
            self.name = name
        if type is not None:
            self.type = type
    def __init__(self, sender_id=None, status=None, type=None, cellphone=None, local_vars_configuration=None):  # noqa: E501
        """NumericCellphoneSender - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._sender_id = None
        self._status = None
        self._type = None
        self._cellphone = None
        self.discriminator = None

        self.sender_id = sender_id
        if status is not None:
            self.status = status
        self.type = type
        self.cellphone = cellphone
Exemple #49
0
    def __init__(self, list_id=None, destination_field=None, segments=None, notify=None, local_vars_configuration=None):  # noqa: E501
        """SendSms - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._list_id = None
        self._destination_field = None
        self._segments = None
        self._notify = None
        self.discriminator = None

        self.list_id = list_id
        self.destination_field = destination_field
        self.segments = segments
        if notify is not None:
            self.notify = notify
Exemple #50
0
    def __init__(self, latitude=None, longitude=None, range=None, local_vars_configuration=None):  # noqa: E501
        """PushCampaignPostRequestGeoOptions - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._latitude = None
        self._longitude = None
        self._range = None
        self.discriminator = None

        if latitude is not None:
            self.latitude = latitude
        if longitude is not None:
            self.longitude = longitude
        if range is not None:
            self.range = range
Exemple #51
0
    def __init__(self, segment_field=None, segment_operator=None, segment_value=None, local_vars_configuration=None):  # noqa: E501
        """SavedSegmentAllOfSegmentFilterSegmentFilterArray - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._segment_field = None
        self._segment_operator = None
        self._segment_value = None
        self.discriminator = None

        if segment_field is not None:
            self.segment_field = segment_field
        if segment_operator is not None:
            self.segment_operator = segment_operator
        if segment_value is not None:
            self.segment_value = segment_value
Exemple #52
0
    def __init__(self, tag_id=None, name=None, color=None, local_vars_configuration=None):  # noqa: E501
        """Tag - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._tag_id = None
        self._name = None
        self._color = None
        self.discriminator = None

        if tag_id is not None:
            self.tag_id = tag_id
        if name is not None:
            self.name = name
        if color is not None:
            self.color = color
Exemple #53
0
    def __init__(self, internal_name=None, public_name=None, group_id=None, local_vars_configuration=None):  # noqa: E501
        """PatchRequestList - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._internal_name = None
        self._public_name = None
        self._group_id = None
        self.discriminator = None

        if internal_name is not None:
            self.internal_name = internal_name
        if public_name is not None:
            self.public_name = public_name
        if group_id is not None:
            self.group_id = group_id
Exemple #54
0
    def __init__(self, cname_id=None, value=None, status=None, local_vars_configuration=None):  # noqa: E501
        """CName - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._cname_id = None
        self._value = None
        self._status = None
        self.discriminator = None

        if cname_id is not None:
            self.cname_id = cname_id
        if value is not None:
            self.value = value
        if status is not None:
            self.status = status
    def __init__(self, type=None, url=None, use_page_title=False, local_vars_configuration=None):  # noqa: E501
        """CampaignEmailContentWebPageAllOf - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._type = None
        self._url = None
        self._use_page_title = None
        self.discriminator = None

        if type is not None:
            self.type = type
        if url is not None:
            self.url = url
        if use_page_title is not None:
            self.use_page_title = use_page_title
    def __init__(self, icon=None, badge=None, sound=None, local_vars_configuration=None):  # noqa: E501
        """PushCampaignPostRequestNotificationOptions - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._icon = None
        self._badge = None
        self._sound = None
        self.discriminator = None

        if icon is not None:
            self.icon = icon
        if badge is not None:
            self.badge = badge
        if sound is not None:
            self.sound = sound
Exemple #57
0
    def __init__(self, segment_filter_array=None, boolean_operator='and', invert=False, local_vars_configuration=None):  # noqa: E501
        """SavedSegmentAllOfSegmentFilter - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._segment_filter_array = None
        self._boolean_operator = None
        self._invert = None
        self.discriminator = None

        if segment_filter_array is not None:
            self.segment_filter_array = segment_filter_array
        if boolean_operator is not None:
            self.boolean_operator = boolean_operator
        if invert is not None:
            self.invert = invert
Exemple #58
0
    def __init__(self, sender_id=None, status=None, phone=None, file=None, local_vars_configuration=None):  # noqa: E501
        """PhoneSender - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._sender_id = None
        self._status = None
        self._phone = None
        self._file = None
        self.discriminator = None

        self.sender_id = sender_id
        if status is not None:
            self.status = status
        self.phone = phone
        self.file = file
Exemple #59
0
    def __init__(self, sender_id=None, status=None, name=None, email=None, local_vars_configuration=None):  # noqa: E501
        """EmailSender - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._sender_id = None
        self._status = None
        self._name = None
        self._email = None
        self.discriminator = None

        self.sender_id = sender_id
        if status is not None:
            self.status = status
        self.name = name
        self.email = email
    def __init__(self, type=None, page_url=None, page_internal_name=None, page_html=None, local_vars_configuration=None):  # noqa: E501
        """CampaignSmartSmsPageContent - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._type = None
        self._page_url = None
        self._page_internal_name = None
        self._page_html = None
        self.discriminator = 'type'

        self.type = type
        self.page_url = page_url
        if page_internal_name is not None:
            self.page_internal_name = page_internal_name
        self.page_html = page_html