本文整理汇总了Python中view.View.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python View.__init__方法的具体用法?Python View.__init__怎么用?Python View.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view.View
的用法示例。
在下文中一共展示了View.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, app):
View.__init__(self, app)
self.app_window.feedview.listbox.connect('row-activated', self.show_entries)
self.app_window.feedhandler.connect("feed-updated", self.update_entryview)
self.listbox = Gtk.ListBox()
self.add(self.listbox)
示例2: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, topoWidget):
View.__init__(self, topoWidget, "Elastic Tree")
self.logDisplay = self.topoWidget.parent.logWidget.logDisplay
utilBtn = QtGui.QPushButton('Change Util Bound')
infoBtn = QtGui.QPushButton('What is ElasticTree?')
self.connect(utilBtn, QtCore.SIGNAL('clicked()'),
self.changeUtil)
self.connect(infoBtn, QtCore.SIGNAL('clicked()'), self.showInfo)
# self.connect(powerBtn, QtCore.SIGNAL('clicked()'),
# self.showPowerStats)
# self.buttons.append(powerBtn)
self.buttons.append(utilBtn)
self.buttons.append(infoBtn)
self.utilBound = 0.01
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, self)
self.slider.setMinimum(0)
self.slider.setMaximum(100)
self.buttons.append(self.slider)
self.sliderValue = 0
self.stats = {} # maps tuples (dpid, port) to utilization
self.powerSliderSignal.connect(self.changeSlider)
self.indicator = QtGui.QLabel()
self.buttons.append(self.indicator)
示例3: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, app):
View.__init__(self, app)
self.app_window.entrylist.listbox.connect('row-activated', self.show_entry_details)
self.scrolled_window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
self.overlay = Gtk.Overlay()
self.web = WebKit.WebView()
self.web.set_size_request(300, 200)
scw = Gtk.ScrolledWindow()
scw.add(self.web)
self.overlay.add(scw)
self.add(self.overlay)
self.headline = ""
self.plot = ""
self.author = ""
self.prev_listbox = None
self.entry_id = None
image = Gtk.Image.new_from_icon_name('edit-redo-symbolic', Gtk.IconSize.BUTTON)
self.browse_button = Gtk.Button(label=" Show Article ", image=image)
self.browse_button.set_valign(Gtk.Align.END)
self.browse_button.set_halign(Gtk.Align.START)
self.browse_button.set_margin_start(20)
self.browse_button.set_margin_bottom(15)
self.browse_button.set_relief(Gtk.ReliefStyle.NONE)
self.browse_button.connect("clicked", self.browse_link)
self.browse_button.set_always_show_image (True)
self.overlay.add_overlay(self.browse_button)
self.overlay.show()
示例4: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, element, composition, timeline):
goocanvas.Group.__init__(self)
View.__init__(self)
Zoomable.__init__(self)
self.element = element
self.comp = composition
self.timeline = timeline
self.bg = goocanvas.Rect(
height=self.__HEIGHT__,
fill_color_rgba=self.__NORMAL__,
line_width=0)
self.content = Preview(self.element)
self.name = goocanvas.Text(
x=10,
text=os.path.basename(unquote(element.factory.name)),
font="Sans 9",
fill_color_rgba=0x000000FF,
alignment=pango.ALIGN_LEFT)
self.start_handle = StartHandle(element, timeline,
height=self.__HEIGHT__)
self.end_handle = EndHandle(element, timeline,
height=self.__HEIGHT__)
for thing in (self.bg, self.content, self.start_handle, self.end_handle, self.name):
self.add_child(thing)
if element:
self.zoomChanged()
self.normal()
示例5: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, topoWidget):
View.__init__(self, topoWidget, "Monitoring")
# Monitoring view buttons
infoBtn = QtGui.QPushButton('What is Monitoring?')
self.connect(infoBtn, QtCore.SIGNAL('clicked()'), self.showInfo)
self.buttons.append(infoBtn)
for b in self.buttons:
b.setCheckable(True)
# maps tuples (dpid, port) to utilization
self.stats = {}
self.topologyInterface.monitoring_received_signal.connect( \
self.got_monitoring_msg )
# Subscribe for linkutils
msg = {}
msg["_mux"] = "gui"
msg ["type"] = "monitoring"
msg ["command"] = "subscribe"
msg ["msg_type"] = "linkutils"
self.topologyInterface.send( msg )
示例6: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, topoWidget):
View.__init__(self, topoWidget, "FlowTracer")
# Buttons
infoBtn = QtGui.QPushButton('What is FlowTracer?')
self.connect(infoBtn, QtCore.SIGNAL('clicked()'), self.showInfo)
traceBtn = QtGui.QPushButton('Trace!')
self.connect(traceBtn, QtCore.SIGNAL('clicked()'), self.trace_flow)
self.buttons.append(infoBtn)
self.buttons.append(traceBtn)
# Signals
self.topologyInterface.flowtracer_received_signal.connect( \
self.got_json_msg )
# Subscribe to messages from backend
msg = {}
msg["_mux"] = "gui"
msg["type"] = "flowtracer"
msg["command"] = "subscribe"
msg["msg_type"] = "highlight"
self.topologyInterface.send( msg )
self.highlighted_path = []
self.querynode = None
示例7: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, topoWidget):
View.__init__(self, topoWidget)
self.name = "Traffic Engineering"
# TE view buttons
TTBtn = QtGui.QPushButton('&Tunnel Table')
TEDBtn = QtGui.QPushButton('Traffic Engineering &Database')
NewTunBtn = QtGui.QPushButton('New Tunnel...')
DelTunBtn = QtGui.QPushButton('Delete Tunnel...')
self.connect(TTBtn, QtCore.SIGNAL('clicked()'), self.handle_TTBtnClick)
self.connect(TEDBtn, QtCore.SIGNAL('clicked()'), self.request_TED)
self.connect(NewTunBtn, QtCore.SIGNAL('clicked()'), self.new_tunnel)
self.connect(DelTunBtn, QtCore.SIGNAL('clicked()'), self.remove_tunnel)
self.buttons.append(TTBtn)
self.buttons.append(TEDBtn)
self.buttons.append(NewTunBtn)
self.buttons.append(DelTunBtn)
self.buttons[0].setCheckable(True)
#self.buttons[2].setCheckable(True)
#self.buttons[3].setCheckable(True)
# tunnel descriptions, taken from te backend
self.tunnels = []
# backup tables, string taken from te backend
self.backup_tables = ""
# unprotected hops per tunnel, string taken from te backend
self.uprotected_hops = ""
# unaccommodated tunnels, string taken from te backend
self.unaccomodated_tunnels = ""
# latest TED, string taken from te backend
self.ted = ""
# tunnel colors (tid:color)
self.tunnel_colors = {'default':QtCore.Qt.blue,\
1:QtGui.QColor(QtCore.Qt.red),\
2:QtGui.QColor(QtCore.Qt.yellow)}
# draw tunnel? (tid:true/false)
self.tunnel_displays = {1:True, 2:True} #{0:False, 1:False}
# connect signals to slots
self.topologyInterface.tunnels_reply_received_signal.connect \
(self.show_tunnel_table)
self.topologyInterface.ted_reply_received_signal.connect \
(self.show_TED)
self.topologyInterface.link_status_change_signal.connect \
(self.update_tunnel_table)
self.popupTT = False
示例8: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, *args):
View.__init__(self, *args)
# Recent files menu
self._recentFiles = LastValues(self.NAME, self._CONFIG_SECTION_MENU,
"recent", 5)
self._actionClearMenu = self._elements["actionClearMenu"]
self._menuRecentFiles = self._menuFile[1]
self._actionClearMenu.triggered.connect(self._recentFiles.clear)
self._actionClearMenu.triggered.connect(self._updateRecentFiles)
# Widgets
self._treeWidget = self._elements["treeWidgetInfo"]
self._tabWidget = self._elements["tabWidgetResults"]
self._tabWidget.setTabBar(ClosableTabBar())
self._widgetConsole = self._elements["widgetConsole"]
self._buttonShowConsole = self._elements["buttonShowConsole"]
self._buttonHideConsole = self._elements["buttonHideConsole"]
self._splitterConsole = self._elements["splitterConsole"]
self._buttonSaveOutput = self._elements["buttonSaveOutput"]
self._textEdit = self._elements["textEditConsole"]
self._tabs = {}
self._treeWidget.setColumnCount(2)
self._treeWidget.header().resizeSection(2, 0)
self._treeWidget.header().setHorizontalScrollMode(
QtGui.QAbstractItemView.ScrollPerPixel)
self._treeWidget.header().setResizeMode(1,
QtGui.QHeaderView.ResizeToContents)
self._treeWidget.header().setResizeMode(2, QtGui.QHeaderView.Fixed)
self._treeWidget.header().setStretchLastSection(True)
self._widgetConsole.setVisible(False)
self._buttonHideConsole.setVisible(False)
self._tabWidget.currentChanged[int].connect(self._displaySelected)
self._tabWidget.tabCloseRequested.connect(self._closeTabOfIndex)
self._buttonShowConsole.clicked.connect(self._showConsole)
self._buttonHideConsole.clicked.connect(self._hideConsole)
self._buttonSaveOutput.clicked.connect(self._saveOutput)
# Actions
self._elements["actionOpen"].triggered.connect(self._openDialog)
self._elements["actionClose"].triggered.connect(self._closeCurrentTab)
self._actionExpand = self._elements["actionExpand"]
self._actionExpandAll = self._elements["actionExpandAll"]
self._actionCollapse = self._elements["actionCollapse"]
self._actionCollapseAll = self._elements["actionCollapseAll"]
# Console channel
self._hideConsole()
consoleChannelHelper = ConsoleChannelHelper(textEdit=self._textEdit)
channels.add(ConsoleChannel, "_ui_console",
console=consoleChannelHelper)
self._splitterConsole.handle(1).setEnabled(False)
# Tab channel
self._resultChannelHelper = ResultChannelHelper(self)
channels.add(ResultChannel, "_ui_result",
result=self._resultChannelHelper)
示例9: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, parent):
View.__init__(self, parent)
self._devices = TestDeviceList(self._elements["treeWidgetDevices"])
self._actionStart = self._elements["actionStart"]
self._actionStop = self._elements["actionStop"]
self._actionPause = self._elements["actionPause"]
self._actionResume = self._elements["actionResume"]
self._actionStart.triggered.connect(self._startTests)
self._actionStop.triggered.connect(self._stopTests)
self._actionPause.triggered.connect(self._pauseTests)
self._actionResume.triggered.connect(self._resumeTests)
self._actionStart.setVisible(True)
self._actionStop.setVisible(False)
self._actionPause.setVisible(False)
self._actionResume.setVisible(False)
# Summary channel
channels.add("SummaryChannel", "_ui_summary")
# Progress channel
pBar = QtGui.QProgressBar()
pBar.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
font = pBar.font()
font.setBold(True)
pBar.setFont(font)
self._parent.getStatusBar().addPermanentWidget(pBar, 1)
self._progress = ProgressChannelHelper(pBar)
channels.add(ProgressChannel, "_ui_progress", progress=self._progress)
self._progress.testStarted.connect(self._onTestStarted)
self._progress.testStopped.connect(self._onTestStopped)
self._progress.stopped.connect(self._onStopped)
self._tests = Tests(self._elements["treeWidgetLocations"],
self._elements["treeWidgetTests"],
self._elements["treeWidgetModels"])
self._elements["actionAdd"].triggered.connect(self._tests.addLocation)
self._elements["actionRemove"].triggered.connect(
self._tests.removeLocation)
self._elements["actionExpand"].triggered.connect(
self._tests.expandSelected)
self._elements["actionExpandAll"].triggered.connect(
self._tests.expandAll)
self._elements["actionCollapse"].triggered.connect(
self._tests.collapseSelected)
self._elements["actionCollapseAll"].triggered.connect(
self._tests.collapseAll)
self._elements["actionRefresh"].triggered.connect(self._tests.refresh)
# Initialize private test variables
self._suiteRuns = 0
self._todoSuites = 0
self._testResult = None
self._testRunner = None
示例10: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, parent):
View.__init__(self, parent)
self._tabWidget = self._elements["tabWidget"]
self._tabWidget.currentChanged[int].connect(self._updateView)
self._tabWidget.tabCloseRequested.connect(self._close)
self._tabWidget.setTabBar(ClosableTabBar())
self._actionRefresh = self._elements["actionRefresh"]
self._actionRefreshAll = self._elements["actionRefreshAll"]
self._actionExpand = self._elements["actionExpand"]
self._actionExpandAll = self._elements["actionExpandAll"]
self._actionCollapse = self._elements["actionCollapse"]
self._actionCollapseAll = self._elements["actionCollapseAll"]
self._actionSearch = self._elements["actionSearch"]
self._actionSave = self._elements["actionSave"]
self._actionSaveAll = self._elements["actionSaveAll"]
self._actionOpen = self._elements["actionOpen"]
self._actionClose = self._elements["actionClose"]
self._actionOpen.triggered.connect(self._openDialog)
self._actionClose.triggered.connect(self._close)
# Recent files menu
self._recentFiles = LastValues(self.NAME, self._CONFIG_SECTION_MENU,
"recent", 5)
self._actionClearMenu = self._elements["actionClearMenu"]
self._menuRecentFiles = self._menuFile[1]
self._actionClearMenu.triggered.connect(self._recentFiles.clear)
self._actionClearMenu.triggered.connect(self.updateRecentFiles)
self._tabs = {}
self._offlineDevs = {}
self._readOnly = False
self.search = SearchDialog(self)
self._actionSearch.triggered.connect(self.search.run)
self._dialogs = {
'keyboard': KeyboardDialog(self),
'mouse': MouseDialog(self)
}
# widgets
self._states = self._elements["listWidgetStates"]
self._relations = self._elements["listWidgetRelations"]
self._attributes = self._elements["treeWidgetAttributes"]
self._text = self._elements["textEditText"]
self._changeText = self._elements["buttonChangeText"]
self._actions = self._elements["groupBoxActions"]
self._actionButtons = QtGui.QButtonGroup(self)
self._value = self._elements["spinBoxValue"]
self._changeValue = self._elements["buttonChangeValue"]
self._mouse = self._elements["buttonMouse"]
self._keyboard = self._elements["buttonKeyboard"]
self.clear()
示例11: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, instance, element, timeline, **kwargs):
self.app = instance
self.element = element
self.timeline = timeline
goocanvas.Image.__init__(self,
pixbuf = TRIMBAR_PIXBUF,
line_width=0,
pointer_events=goocanvas.EVENTS_FILL,
**kwargs
)
View.__init__(self)
Zoomable.__init__(self)
示例12: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, topoWidget):
View.__init__(self, topoWidget)
self.name = "Monitoring"
# Monitoring view buttons
mrSvcBtn = QtGui.QPushButton('&MapReduce Cluster')
storageSvcBtn = QtGui.QPushButton('&Storage Cluster')
resetSvcBtn = QtGui.QPushButton('&Reset')
infoBtn = QtGui.QPushButton('What is Monitoring?')
'''
self.connect(mrSvcBtn, QtCore.SIGNAL('clicked()'),
self.show_map_reduce_cluster)
self.connect(storageSvcBtn, QtCore.SIGNAL('clicked()'),
self.show_storage_cluster)
self.connect(resetSvcBtn, QtCore.SIGNAL('clicked()'),
self.reset_services)
'''
self.connect(infoBtn, QtCore.SIGNAL('clicked()'),
self.show_monitoring_info)
self.buttons.append(mrSvcBtn)
self.buttons.append(storageSvcBtn)
self.buttons.append(resetSvcBtn)
self.buttons.append(infoBtn)
for b in self.buttons:
b.setCheckable(True)
#self.buttons[0].setChecked(True)
self.stats = {} # maps tuples (dpid, port) to utilization
self.service_subset = set([])
self.service_name = ""
# Connect methods to signals
#self.get_port_stats_sig.connect( self.get_port_stats )
# Connect to signal from communication to handle switch query replies
#self.topologyInterface.switch_query_reply_received_signal.connect( \
# self.show_stats_reply )
#self.topologyInterface.topology_received_signal.connect( \
# self.show_topology_reply )
self.topologyInterface.monitoring_received_signal.connect( \
self.got_monitoring_msg )
# Subscribe for linkutils
msg = {}
msg ["type"] = "monitoring"
msg ["command"] = "subscribe"
msg ["msg_type"] = "linkutils"
self.topologyInterface.send( msg )
示例13: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, topoWidget):
View.__init__(self, topoWidget, "RAD")
#self.name = "RAD"
self.logDisplay = self.topoWidget.parent.logWidget.logDisplay
infoBtn = QtGui.QPushButton('What is RAD?')
self.connect(infoBtn, QtCore.SIGNAL('clicked()'), self.showInfo)
self.buttons.append(infoBtn)
self.nodeMenu.addAction( 'Draw DAG', self.draw_DAG )
示例14: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, environment):
View.__init__(self)
self.environ = environment
self.currmessage = ''
self.currrule = ''
#self.currdetstatus = ''
#self.currstatus = ''
self.percentage = 0
self.normal = [LogPriority.CRITICAL, LogPriority.ERROR,
LogPriority.WARNING]
self.verbose = [LogPriority.CRITICAL, LogPriority.INFO,
LogPriority.ERROR, LogPriority.WARNING]
示例15: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import __init__ [as 别名]
def __init__(self, topoWidget):
View.__init__(self, topoWidget, "Default")
self.a = QtGui.QLabel(" Toggle: (<font color='green'>N</font>)odes")
self.b = QtGui.QLabel(" Node(<font color='green'>I</font>)Ds \
Lin(<font color='green'>K</font>)s")
self.c = QtGui.QLabel(" (<font color='green'>L</font>)inkIDs \
(<font color='green'>P</font>)orts")
self.d = QtGui.QLabel(" (<font color='green'>R</font>)efresh \
Topology")
self.buttons.append(self.a)
self.buttons.append(self.b)
self.buttons.append(self.c)
self.buttons.append(self.d)