def __init__(self, data, parent=None): self.data = data if isinstance(data, Species): text = data.name self.amounts_index = data.index elif isinstance(data, Compartment): text = data.compartment_name_and_xy_coords() self.amounts_index = data.index elif isinstance(data, Run): text = "%s" % (data._run_number) self.amounts_index = data._run_number - 1 # elif isinstance(data, Simulation): # text = "%s %s" % (data.model_input_file, data.simulation_start_time) # self.amounts_index = None else: raise TypeError("type of data is not recognised") QListWidgetItem.__init__(self, text, parent, QListWidgetItem.UserType) # QObject::startTimer: QTimer can only be used with threads started with QThread if isinstance(self.amounts_index, int): self.setToolTip('%d' % self.amounts_index)
def __init__(self, x=np.arange(1, 1025, 1), y=np.zeros_like(np.arange(1, 1025, 1)), bkg=np.zeros_like(np.arange(1, 1025, 1)), fname='omaspec', time='', exptime='', damode='', dtemp='', snumber='', iscans='', monochromator_model='Jarrel Ash', grating_info=[], monochromator_counter='', spec_type='spec', ): QListWidgetItem.__init__(self) self.spec_type = spec_type self.fname = fname self.time = time self.exptime = exptime self.damode = damode self.dtemp = dtemp self.snumber = snumber self.ignoredscans = iscans self.monochromator_model = monochromator_model self.grating_info = grating_info self.monochromator_counter = monochromator_counter self.bkg = bkg self.x = x self.y = y
def __init__(self, text, parent=None, italic=False): QListWidgetItem.__init__(self, text, parent) font = self.font() font.setPointSize(10) if italic: font.setItalic(True) self.setFont(font) self.clickeable = False
def __init__(self, text, hiddentext, settings): QListWidgetItem.__init__(self, text) self.settings = settings self.hiddentext = hiddentext self.timestamp = self.getTimeStamp() self.filetime = self.getFileTime() self.system = self.getSystemName() self.valid_market = False
def __init__(self, song, oneLine=False): QListWidgetItem.__init__(self) self.icon = False self.song = song if oneLine: self.setText(mpdlibrary.songArtist(song) + ' - ' + mpdlibrary.songTitle(song)) else: self.setText(mpdlibrary.songTitle(song) + '\n' + mpdlibrary.songArtist(song)) self.setToolTip("Album:\t %s\nTime:\t %s\nFile:\t %s" % (mpdlibrary.songAlbum(song), str(mpdlibrary.songTime(song)) , song['file']))
def __init__(self, feature, form, layer): QListWidgetItem.__init__(self) self.editform = form self.feature = feature self._layer = layer formname = "Default"'' if not form == "Default": formname = "Edit %s" % form.nameforform(str(layer.name())) self.setText("%s for item no. %s" % ( formname , str(self.feature.id()) ))
def __init__(self, active=True, parent=None): self.active = active QListWidgetItem.__init__(self, parent) self.set_color() font = QFont(QFont.SansSerif) font.setStyleHint(QFont.Monospace) font.setPointSize(10) font.setFixedPitch(True) self.setFont(font) self.setTextAlignment(4)
def __init__(self, module, parent=None): QListWidgetItem.__init__(self, parent, QListWidgetItem.UserType) self.parent = parent self.module = module # self.widget.setAcceptDrops(True) # self.widget.p = self self.nameLabel = QLabel(QString(module.name)) self.descriptionLabel = QLabel(QString(" " + module.description)) self.generateWidget(module.name, module.description)
def __init__(self, text, hiddentext, settings): QListWidgetItem.__init__(self, text) self.settings = settings self.hiddentext = hiddentext self.color_image = self.addImage(hiddentext) #self.image = cv2.cvtColor(self.color_image, cv2.COLOR_BGR2GRAY) self.preview_image = self.addPreviewImage() self.timestamp = self.getTimeStamp() self.filetime = self.getFileTime() self.system = self.getSystemName()
def __init__(self, partClass): name = partClass.name() # partClass.name is a ki18n object QListWidgetItem.__init__(self, name, score) self.w = QGroupBox(name) partSettings.addWidget(self.w) self.part = partClass() layout = QVBoxLayout(self.w) self.part.widgets(layout) layout.addStretch(1) if score.count() == 1: score.setCurrentRow(0) self.setSelected(True) parent.enableButton(KPageDialog.Try, True)
def __init__(self, text, hiddentext, settings): QListWidgetItem.__init__(self, text) self.settings = settings self.hiddentext = hiddentext self.timestamp = self.getTimeStamp() self.filetime = self.getFileTime() #self.filetime = ["14", "12", "23", "18", "58", "30"] self.system = self.getSystemName() self.valid_market = False self.img_height = 0 self.market_width = 0 self.ocr_areas = None
def __init__(self, _data, parent=None): # ------------------------------------------------------------------- QListWidgetItem.__init__(self, parent); # ------------------------------------------------------------------- self.LOG_TAG = str(self.__class__.__name__).upper(); self.DEBUG = False; #self.setBackground(QBrush brush); #self.setBackgroundColor( QColor("#000") ); #self.setTextColor( QColor("#FFF") ); self.setText( _data );
def __init__(self, qnotero, zoteroItem, parent=None): """ Constructor Arguments: qnotero -- a Qnotero instance zoteroItem -- a ZoteroItem Keyword arguments: parent -- a parent QWidget (default=None) """ QListWidgetItem.__init__(self, zoteroItem.hashKey(), parent) self.qnotero = qnotero self.zoteroItem = zoteroItem
def __init__(self, name = "Module", description = "Description...", domain = "StellarEvolution", className = "ClassName", codeLocation = "amuse/path/to/code/location", isParallel = False, stoppingConditions = [], stoppingConditionsEnabled = [], parameters = []): """Initializes a new Module with the given instance data. @param name: The full name of the module. @param description: A description of the module's purpose (in other words, the calculations performed by the module). @param domain: The astrophysical domain into which the module has been sorted. @param className: The name of the AMUSE class containing the module code. @param codeLocation: The location of the AMUSE module code. @param isParallel: Whether the module's calculations can be parallelized across multiple workers by MPI. @param stoppingConditions: The condition(s) under which the module may stop executing prematurely. @param parameters: The module parameters. These module-specific values may be modified prior to running the experiment in order to fine-tune the module's behavior.""" self.name = name self.description = description self.domain = domain self.codeLocation = codeLocation self.isParallel = isParallel self.stoppingConditions = stoppingConditions self.stoppingConditionsEnabled = stoppingConditionsEnabled self.parameters = parameters self.className = className self.interfaceName = None # Set up the module's name so that it can be displayed in GUI list boxes QListWidgetItem.__init__(self) self.setText(self.name)
def __init__(self, text, hiddentext, settings): QListWidgetItem.__init__(self, text) self.settings = settings self.hiddentext = hiddentext self.timestamp = self.getTimeStamp() self.filetime = self.getFileTime() self.log_file = None self.search_time = None self.system = self.getSystemName() if len(self.system) > 0: self.station = self.getStationName(self.search_time) else: self.station = None self.valid_market = False self.img_height = 0 self.market_width = 0 self.offset = None self.ocr_areas = None
def __init__(self, name='', desc=QString(), path=''): if path == '': QListWidgetItem.__init__(self, name) self.desc = desc self.links = [] self.hash = hashlib.sha1(str(self.text().toUtf8())).hexdigest() self.DescChanged = 1 self.LinksChanged = 1 if path != '': self.desc = QString() f = open(path + '/name.txt', 'r') QListWidgetItem.__init__(self, QString(unicode(f.readline(), 'UTF8'))) f.close() self.hash = hashlib.sha1(str(self.text().toUtf8())).hexdigest() self.DescChanged = 0 self.setFlags(Qt.ItemIsEditable | Qt.ItemIsSelectable | Qt.ItemIsEnabled) f = open(path + '/links.txt', 'r') self.links = [QString(unicode(l[:len(l) - 1], 'UTF8')) for l in f.readlines()] f.close() self.LinksChanged = 0
def __init__(self, item_text, icon): QListWidgetItem.__init__(self) self.params = {} self.is_meta = False self.is_totem = False if item_text.startswith('#'): 'this is a metadata line, so set color and make it unselectable ' self.is_meta = True if item_text.startswith('#EXTINF'): item_text = item_text[11:] else: item_text = item_text[1:] self.parse_params(item_text) self.setFlags(self.flags() ^ Qt.ItemIsSelectable ^ Qt.ItemIsEnabled) self.setBackgroundColor(QColor('#CEE1B6')) self.setTextColor(QColor('#9F5700')) else: 'this is a URL' self.setIcon(icon) MediaItem.num_items += 1 self.setText(item_text) self.setStatusTip(item_text)
def __init__(self, text, tooltip, library): self.library = library QListWidgetItem.__init__(self) self.setText(text) self.setToolTip('\n'.join(tooltip))
def __init__(self, song, oneLine=False): QListWidgetItem.__init__(self) self.oneLine = oneLine self.iconPath = '' self.song = song self._updateText()
def __init__(self, job, *args, **kwargs): QListWidgetItem.__init__(self, *args, **kwargs) self.job = job
def __init__(self, text, library): self.library = library QListWidgetItem.__init__(self) self.setText(text)
def __init__(self, data): QListWidgetItem.__init__(self, QIcon(self.icons[data[0]]), "\n") self._data = data
def __init__(self, iface, parent=None): self.iface = iface QListWidgetItem.__init__(self, iface.hard_label, parent, QListWidgetItem.UserType)
def __init__(self, song, oneLine, parent): QListWidgetItem.__init__(self) self.oneLine = oneLine self.iconPath = '' self.song = song parent.connect(parent, SIGNAL('oneLinePlaylist'), self._setOneLine)
def __init__(self): """ Constructor to initialize. """ QListWidgetItem.__init__(self) self.highlight_color = "black"
def __init__(self, item): QListWidgetItem.__init__(self) value = item.name self.setText(value) self.value = value self.kind = item.kind
def __init__(self, text): QListWidgetItem.__init__(self, text) self.setTextColor(QColor(0, 0, 255))
def __init__(self, parent, collection, language): QListWidgetItem.__init__(self, parent) self.collection = collection self.setText(collection.translations[language][0])
def __init__(self, feature, layer): QListWidgetItem.__init__(self) self.feature = feature self._layer = layer self.setText("{} on {}".format(feature.id(), layer.name()))
def __init__(self, code, label): QListWidgetItem.__init__(self) self.code = code self.label = label self.setText(label)
def __init__(self, data): QListWidgetItem.__init__(self, QIcon(self.icons[data.type]), "\n") self._data = data
def __init__(self, name, path): QListWidgetItem.__init__(self, name) self.path = path
def __init__(self, housing, *args, **kwargs): QListWidgetItem.__init__(self, *args, **kwargs) self.housing = housing self.read = True
def __init__(self, txt): QListWidgetItem.__init__(self, txt) self.initial_value = QString(txt) self.current_value = QString(txt) self.previous_value = QString(txt)
def __init__(self, text, name, icon, parent, code): QListWidgetItem.__init__(self, icon, text, parent) STDMContent.__init__(self, code) self.Name = name + " " + QApplication.translate("STDMEntity", "Entity")
def __init__(self, new_word): QListWidgetItem.__init__(self, new_word.word.word) self.article_id = new_word.article_id self.word_content = new_word.word_content
def __init__(self): QListWidgetItem.__init__() QPushButton.__init__("text")
def __init__(self,parent,name=None,url=None,pos=None): QListWidgetItem.__init__(self,parent) self.name=name self.url=url self.pos=pos
def __init__(self, text, mpdclient): self.mpdclient = mpdclient QListWidgetItem.__init__(self) self.setText(text)
def __init__(self, icon, name, node): QListWidgetItem.__init__(self, icon, name) self.__node = node self.__table = None
def __init__(self, nebindex, *args, **kwargs): text="nebindex %d"% nebindex QListWidgetItem.__init__(self, text) self.tsview = _TransitionStateView(nebindex, *args, **kwargs)
def __init__(self, tag = None, count = None): QListWidgetItem.__init__(self) self.nodesCount = count self.__tag = tag