本文整理汇总了Python中page.Page.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Page.__init__方法的具体用法?Python Page.__init__怎么用?Python Page.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self, testsetup):
Page.__init__(self, testsetup)
handles = self.selenium.window_handles
for i in handles:
self.selenium.switch_to_window(i)
if self.selenium.title == "BrowserID": break
示例2: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self, testsetup, lookup):
Page.__init__(self, testsetup)
self.lookup = lookup
if type(lookup) is int:
self._root_locator = (self._base_locator[0], "%s[%i]" % (self._base_locator[1], lookup))
elif type(lookup) is unicode:
self._root_locator = (self._base_locator[0], "%s[h3[normalize-space(text()) = '%s']]" % (self._base_locator[1], lookup))
示例3: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
self.model = gtk.ListStore(object,str,str,str)
Page.__init__(self)
self.cfg = PythmConfig()
self.btn_connect = ImageButton(gtk.STOCK_CONNECT)
self.btnbox.add(self.btn_connect)
self.btn_connect.connect("clicked",self.btn_connect_clicked)
self.btn_start = ImageButton(gtk.STOCK_EXECUTE)
self.btnbox.add(self.btn_start)
self.btn_start.connect("clicked",self.btn_start_clicked)
self.btn_stop = ImageButton(gtk.STOCK_STOP)
self.btnbox.add(self.btn_stop)
self.btn_stop.connect("clicked",self.btn_stop_clicked)
self.btn_refresh = ImageButton(gtk.STOCK_REFRESH)
self.btnbox.add(self.btn_refresh)
self.btn_refresh.connect("clicked",self.btn_refresh_clicked)
self.mgr = BackendManager()
if self.cfg.get_backend() != None:
self.start_backend(self.cfg.get_backend())
self.refresh()
self.row_selected(None)
self.set_sensitive(True)
示例4: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
self.duration = 0.0 # Druation of current song.
self.posBarPressed = False # Set song position from backend in slider.
self.posBarDownVal = -1
Page.__init__(self);
self.cfg.get_backend().connect(Signals.VOLUME_CHANGED,self.volume_changed)
self.cfg.get_backend().connect(Signals.RANDOM_CHANGED,self.random_changed)
self.cfg.get_backend().connect(Signals.REPEAT_CHANGED,self.repeat_changed)
self.cfg.get_backend().connect(Signals.SONG_CHANGED,self.song_changed)
self.cfg.get_backend().connect(Signals.POS_CHANGED,self.pos_changed)
self.cfg.get_backend().connect(Signals.STATE_CHANGED,self.state_changed)
self.btn_prev = ImageButton(gtk.STOCK_MEDIA_PREVIOUS)
self.btnbox.add(self.btn_prev)
self.btn_stop = ImageButton(gtk.STOCK_MEDIA_STOP)
self.btnbox.add(self.btn_stop)
self.btn_pause = ImageButton(gtk.STOCK_MEDIA_PAUSE)
self.btnbox.add(self.btn_pause)
self.btn_play = ImageButton(gtk.STOCK_MEDIA_PLAY)
self.btnbox.add(self.btn_play)
self.btn_next = ImageButton(gtk.STOCK_MEDIA_NEXT)
self.btnbox.add(self.btn_next)
self.btn_play.connect("clicked", self.btn_clicked)
self.btn_stop.connect("clicked", self.btn_clicked)
self.btn_prev.connect("clicked", self.btn_clicked)
self.btn_next.connect("clicked", self.btn_clicked)
self.btn_pause.connect("clicked", self.btn_clicked)
self.volevent = False
示例5: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
Page.__init__(self)
self._current_line = 0
self._tail = False
self._content = ""
with open("/tmp/clazy.json", 'r') as f:
self._parse_lines(f.read())
f.close()
示例6: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self, path):
Page.__init__(self)
module,name=path.rsplit('.', 1)
app=__import__(module, fromlist=[ name ])
self.app=getattr(app, name)()
示例7: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
Page.__init__(self)
self._current_line = 0
self._code = [
"NumberWrapper* wrap3 = nullptr;",
"",
"//Check if the URI is complete or short",
"const bool hasAtSign = uri.hasHostname();",
"",
"// Append the account hostname, this should always reach the same destination",
"// as long as the server implementation isn't buggy.",
"const auto extendedUri = (hasAtSign || !account) ? uri : URI(QStringLiteral(\"%[email protected]%2\")",
" .arg(uri)",
" .arg(account->hostname()));",
"",
"//Try to see if there is a better candidate with a suffix (LAN only)",
"if ( !hasAtSign && account ) {",
"",
" // Attempt an early candidate using the extended URI. The later",
" // `confirmedCandidate2` will attempt a similar, but less likely case.",
" if ((wrap2 = d_ptr->m_hDirectory.value(extendedUri))) {",
" if (auto cm = d_ptr->fillDetails(wrap2, extendedUri, account, contact, type))",
" return cm;",
" }",
"}",
"",
"//Check",
"ContactMethod* confirmedCandidate = d_ptr->fillDetails(wrap,uri,account,contact,type);",
"",
"//URIs can be represented in multiple way, check if a more verbose version",
"//already exist",
"ContactMethod* confirmedCandidate2 = nullptr;",
"",
"//Try to use a ContactMethod with a contact when possible, work only after the",
"//contact are loaded",
"if (confirmedCandidate && confirmedCandidate->contact())",
" confirmedCandidate2 = d_ptr->fillDetails(wrap2,uri,account,contact,type);",
"",
"ContactMethod* confirmedCandidate3 = nullptr;",
"",
"//Else, try to see if the hostname correspond to the account and flush it",
"//This have to be done after the parent if as the above give \"better\"",
"//results. It cannot be merged with wrap2 as this check only work if the",
"//candidate has an account.",
"if (hasAtSign && account && uri.hostname() == account->hostname()) {",
" if ((wrap3 = d_ptr->m_hDirectory.value(uri.userinfo()))) {",
" foreach(ContactMethod* number, wrap3->numbers) {",
" if (number->account() == account) {",
" if (contact && ((!number->contact()) || (contact->uid() == number->contact()->uid())))",
" number->setPerson(contact); //TODO Check all cases from fillDetails()",
" //TODO add alternate URI",
" confirmedCandidate3 = number;",
" break;",
" }",
" }",
" }",
"}",
]
示例8: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self, driver):
Page.__init__(self, driver)
self.altom_logo = Element(self.driver, (By.XPATH, ".//*[@id='site-title']/a/img"))
self.sidebar = Element(self.driver, (By.CLASS_NAME, "sidebar"))
self.main_content = Element(self.driver, (By.ID, "mainContent"))
self.main_menu = Element(self.driver, (By.ID, "mainMenu"))
self.video = Element(self.driver, (By.ID, "presentation"))
self.phone_number = Element(self.driver, (By.CLASS_NAME, "mainPhone"))
self.blocks = Element(self.driver, (By.CLASS_NAME, "blocks"))
示例9: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self, testsetup):
Page.__init__(self, testsetup)
self.selenium.wait_for_pop_up("", self.timeout)
handles = self.selenium.get_all_window_titles()
for i in handles:
self.selenium.select_window(i)
if self.selenium.get_title == self._pop_up_title:
self.selenium.window_focus()
break
示例10: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
#id, artist, title, album, ('>' when playing)
self.model = gtk.ListStore(object,str,str,str,str)
Page.__init__(self)
self.cfg.get_backend().connect(Signals.PL_CHANGED,self.load_list)
self.cfg.get_backend().connect(Signals.SONG_CHANGED,self.song_changed)
self.btn_up = ImageButton(gtk.STOCK_GO_UP)
self.btnbox.add(self.btn_up)
self.btn_down = ImageButton(gtk.STOCK_GO_DOWN)
self.btnbox.add(self.btn_down)
self.btn_play = ImageButton(gtk.STOCK_MEDIA_PLAY)
self.btnbox.add(self.btn_play)
#self.btn_del = ImageButton(gtk.STOCK_REMOVE)
#self.btnbox.add(self.btn_del)
self.btn_clear = ImageButton(gtk.STOCK_CLEAR)
self.btnbox.add(self.btn_clear)
self.btn_up.connect("clicked",self.clicked_up)
self.btn_down.connect("clicked",self.clicked_down)
self.btn_play.connect("clicked",self.clicked_play)
#self.btn_del.connect("clicked",self.clicked_del)
self.btn_clear.connect("clicked",self.clicked_clear)
示例11: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
self.model = gtk.ListStore(object, str)
Page.__init__(self)
self.btn_up = ImageButton(gtk.STOCK_GO_UP)
self.btnbox.add(self.btn_up)
self.btn_up.connect("clicked", self.btn_up_clicked)
self.btn_open = ImageButton(gtk.STOCK_OPEN)
self.btnbox.add(self.btn_open)
self.btn_open.connect("clicked", self.btn_open_clicked)
self.btn_play = ImageButton(gtk.STOCK_MEDIA_PLAY)
self.btnbox.add(self.btn_play)
self.btn_play.connect("clicked", self.btn_play_clicked)
self.path = None
self.btn_adddir = ImageButton(gtk.STOCK_ADD)
self.btnbox.add(self.btn_adddir)
self.btn_adddir.connect("clicked", self.btn_adddir_clicked)
self.path = None
self.cfg.get_backend().connect(Signals.BROWSER_CHANGED, self.browser_changed)
示例12: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
Page.__init__(self)
示例13: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self, testsetup, open_url=True):
''' Creates a new instance of the class and gets the page ready for testing '''
Page.__init__(self, testsetup)
if open_url:
self.selenium.get(self.base_url)
示例14: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self):
Page.__init__(self)
self.height = 8
self._entry = None
示例15: __init__
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import __init__ [as 别名]
def __init__(self, testsetup, banner):
Page.__init__(self, testsetup)
self._root_element = banner