本文整理汇总了Python中PySide.QtCore.QRegExp.setCaseSensitivity方法的典型用法代码示例。如果您正苦于以下问题:Python QRegExp.setCaseSensitivity方法的具体用法?Python QRegExp.setCaseSensitivity怎么用?Python QRegExp.setCaseSensitivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore.QRegExp
的用法示例。
在下文中一共展示了QRegExp.setCaseSensitivity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtCore import QRegExp [as 别名]
# 或者: from PySide.QtCore.QRegExp import setCaseSensitivity [as 别名]
def __init__(self, delegate, username=None):
super(FnFrameioWidget, self).__init__()
global gIconPath
self._clips = []
self._sequences = []
self.username = username
# FrameioDelegate
self.delegate = delegate #kwargs.get("delegate", None)
# setGeometry(x_pos, y_pos, width, height)
self.setGeometry(240, 160, 726, 552)
self.setStyleSheet('QWidget {background-color: #3B3E4A;} QLineEdit {color: #D0D5DC; border-color:#6F757F; border-width: 1px; border-radius: 4px; border-style: solid;} QLabel {color: #D0D5DC;}')
self.setWindowTitle("Frame.io Uploader")
#self.setAttribute( Qt.WA_TranslucentBackground, True )
self.setWindowFlags( Qt.FramelessWindowHint )
self.setMouseTracking(True)
self.draggable = True
self.dragging_threshold = 0
self.__mousePressPos = None
self.__mouseMovePos = None
layout = QtGui.QVBoxLayout(self)
layout.setAlignment(Qt.AlignCenter)
self.toolBar = QtGui.QToolBar()
self.toolBar.setStyleSheet('QToolBar {background-color: #3B3E4A; border-width: 0px; border-radius: 0px; border-style: none;}')
self.closeButton = QtGui.QPushButton("")
self.closeButton.setStyleSheet('QPushButton {border: none;}')
icon = QtGui.QIcon(os.path.join(gIconPath + "close.png"))
self.closeButton.setIcon(icon)
self.closeButton.clicked.connect(self.close)
self.toolBar.addWidget(self.closeButton)
layout.addWidget(self.toolBar)
pixmap = QtGui.QPixmap(os.path.join(gIconPath + "logo-64px.png"))
lbl = QtGui.QLabel("")
lbl.setPixmap(pixmap)
lbl.setAlignment(Qt.AlignCenter)
layout.addWidget(lbl)
font = QtGui.QFont()
font.setPointSize(20)
self.topLabel = QtGui.QLabel("Sign In")
self.topLabel.setFont(font)
self.topLabel.setAlignment(Qt.AlignCenter)
layout.addWidget(self.topLabel)
self.statusLabel = QtGui.QLabel("")
self.statusLabel.setAlignment(Qt.AlignCenter)
layout.addWidget(self.statusLabel)
self.stackView = QtGui.QStackedWidget(self)
# Login Screen View
self.loginView = QtGui.QWidget()
self.loginViewLayout = QtGui.QVBoxLayout(self)
self.loginViewLayout.setAlignment(Qt.AlignCenter)
self.emailLineEdit = QtGui.QLineEdit()
self.emailLineEdit.setPlaceholderText("E-mail")
self.emailLineEdit.setFont(font)
self.emailLineEdit.setAlignment(Qt.AlignCenter)
self.emailLineEdit.setFixedWidth(370)
self.emailLineEdit.setFixedHeight(60)
if self.username:
self.emailLineEdit.setText(self.username)
# Validator for checking email address is valid
namerx = QRegExp("\\b[A-Z0-9._%+-][email protected][A-Z0-9.-]+\\.[A-Z]{2,4}\\b")
namerx.setCaseSensitivity(Qt.CaseInsensitive);
namerx.setPatternSyntax(QRegExp.RegExp);
self.nameval = QtGui.QRegExpValidator(namerx, self)
self.emailLineEdit.setValidator(self.nameval)
self.loginViewLayout.addWidget(self.emailLineEdit)
self.passwordLineEdit = QtGui.QLineEdit()
self.passwordLineEdit.setStyleSheet('')
self.passwordLineEdit.setPlaceholderText("Password")
self.passwordLineEdit.setFont(font)
self.passwordLineEdit.setAlignment(Qt.AlignCenter)
self.passwordLineEdit.setFixedWidth(370)
self.passwordLineEdit.setFixedHeight(60)
self.passwordLineEdit.setEchoMode(QtGui.QLineEdit.Password)
self.loginViewLayout.addWidget(self.passwordLineEdit)
self.submitButton = QtGui.QPushButton("LET'S GO")
self.submitButton.setFlat(True)
self.submitButton.setFont(font)
self.submitButton.clicked.connect(self._submitButtonPressed)
#.........这里部分代码省略.........
示例2: __init__
# 需要导入模块: from PySide.QtCore import QRegExp [as 别名]
# 或者: from PySide.QtCore.QRegExp import setCaseSensitivity [as 别名]
def __init__(self, delegate, usingExportDialog=False):
QtGui.QDialog.__init__(self)
self._clips = []
self._sequences = []
self.filePathsForUpload = []
# The Main FrameIOPySide AppDelegate
self.delegate = delegate
# The Dialog can work in two modes, as a popover from the Bin View or via the main App Export window
self.usingExportDialog = usingExportDialog
self.email = ""
# setGeometry(x_pos, y_pos, width, height)
self.setGeometry(240, 160, 726, 552)
self.setStyleSheet('QWidget {background-color: #3B3E4A;} QLineEdit {color: #D0D5DC; border-color:#6F757F; border-width: 1px; border-radius: 4px; border-style: solid;} QLabel {color: #D0D5DC;}')
self.setWindowTitle("Frame.io Uploader")
#self.setAttribute( Qt.WA_TranslucentBackground, True )
self.setWindowFlags( Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint )
self.setMouseTracking(True)
self.draggable = True
self.dragging_threshold = 0
self.__mousePressPos = None
self.__mouseMovePos = None
layout = QtGui.QVBoxLayout(self)
layout.setAlignment(Qt.AlignCenter)
self.toolBar = QtGui.QToolBar()
self.toolBar.setStyleSheet('QToolBar {background-color: #3B3E4A; border-width: 0px; border-radius: 0px; border-style: none; text-align: center}')
self.toolBar.setIconSize( QSize(24,24) )
self.closeButton = QtGui.QPushButton("")
self.closeButton.setStyleSheet('QPushButton {border: none;}')
iconClose = QtGui.QIcon(os.path.join(gIconPath, "close.png"))
self.closeButton.setIcon(iconClose)
self.closeButton.clicked.connect(self.close)
iconLogout = QtGui.QIcon(os.path.join(gIconPath, "logout.png"))
self.logoutToolBarAction = createMenuAction("", self.logoutPressed, icon=iconLogout)
self.logoutToolBarAction.setVisible(False)
self.logoutToolBarAction.setToolTip("Click here to Log out")
self.unconnectedIndicatorPixmap = QtGui.QPixmap(os.path.join(gIconPath, "logo-unconnected.png"))
self.connectedIndicatorPixmap = QtGui.QPixmap(os.path.join(gIconPath, "logo-connected.png"))
self.connectionIndicatorLabel = QtGui.QLabel("Unconnected")
spacer = QtGui.QWidget()
spacer.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.toolBar.addWidget(self.closeButton)
self.toolBar.addWidget(spacer)
self.toolBar.addWidget(self.connectionIndicatorLabel)
self.toolBar.addAction(self.logoutToolBarAction)
layout.addWidget(self.toolBar)
pixmap = QtGui.QPixmap(os.path.join(gIconPath, "frameio.png"))
lbl = QtGui.QLabel("")
lbl.setPixmap(pixmap)
lbl.setAlignment(Qt.AlignCenter)
layout.addWidget(lbl)
font = QtGui.QFont()
font.setPointSize(20)
self.topLabel = QtGui.QLabel("Login")
self.topLabel.setFont(font)
self.topLabel.setAlignment(Qt.AlignCenter)
layout.addWidget(self.topLabel)
self.statusLabel = QtGui.QLabel("")
self.statusLabel.setAlignment(Qt.AlignCenter)
layout.addWidget(self.statusLabel)
self.stackView = QtGui.QStackedWidget(self)
# Login Screen View
self.loginView = QtGui.QWidget()
self.loginViewLayout = QtGui.QVBoxLayout(self)
self.loginViewLayout.setAlignment(Qt.AlignCenter)
self.emailLineEdit = QtGui.QLineEdit()
self.emailLineEdit.setPlaceholderText("E-mail")
self.emailLineEdit.setFont(font)
self.emailLineEdit.setAlignment(Qt.AlignCenter)
self.emailLineEdit.setFixedWidth(370)
self.emailLineEdit.setFixedHeight(60)
if self.email:
self.emailLineEdit.setText(self.email)
self.emailLineEdit.setText("")
# Validator for checking email address is valid
namerx = QRegExp("\\b[A-Z0-9._%+-][email protected][A-Z0-9.-]+\\.[A-Z]{2,4}\\b")
namerx.setCaseSensitivity(Qt.CaseInsensitive);
namerx.setPatternSyntax(QRegExp.RegExp);
self.nameval = QtGui.QRegExpValidator(namerx, self)
#.........这里部分代码省略.........
示例3: handleOddsHtmlPage
# 需要导入模块: from PySide.QtCore import QRegExp [as 别名]
# 或者: from PySide.QtCore.QRegExp import setCaseSensitivity [as 别名]
def handleOddsHtmlPage(self, htmlPage, source=BETEXPLORER_SOURCE):
print "handleOddsHtmlPage source = %d" % source
epochDate = self._gridList[self._index][1]
date = QDateTime()
date.setMSecsSinceEpoch(int(epochDate) * 1000)
deprecated = QDateTime.currentDateTime() > date.addDays(+1)
strHtml = str(htmlPage)
if source == BETEXPLORER_SOURCE:
oddsRx = QRegExp(
"<a href=.*data-odd-max=\"(\\d*\.\\d*)\".*data-odd-max=\"(\\d*\.\\d*)\".*data-odd-max=\"(\\d*\.\\d*)\".*>")
elif source == ZULUBET_SOURCE:
oddsRx = QRegExp(
"<td\\s*class=\"aver_odds_full\"\\s*align=\"center\">(\\d*\.\\d*)</td><td\\s*class=\"aver_odds_full\"\\s*align=\"center\">(\\d*\.\\d*)</td><td\\s*class=\"aver_odds_full\"\\s*align=\"center\">(\\d*\.\\d*)</td>")
for match in self._grid.matches():
if not match.cotesDisponibles():
if source == BETEXPLORER_SOURCE and not deprecated:
team1Rx = QRegExp(
"><span>(\\w*[\\'\\.-]?\\s*)*(%s)(\\w*[\\'\\.-]?\\s*)*</span>\\s*-\\s*<span>\\s*((\\w*[\\'\\.-]?\\s*)*)</span><" % match.team1())
team1Rx.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
team2Rx = QRegExp(
"><span>\\s*(\\w*[\\'\\.-]?\\s*)*</span>\\s*-\\s*<span>(\\w*[\\'\\.-]?\\s*)*(%s)(\\w*[\\'\\.-]?\\s*)*</span><" % match.team2())
team2Rx.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
elif source == ZULUBET_SOURCE:
team1Rx = QRegExp(
#"<img\\s*src=\"http://www\.zulubet\.com/flags/flag-\\w*\.png\"\\s*class=\"flags\\s*flag-\\w*\"\\s*title=\"(\\w*\\'?\\s*-?)*,(\\w*\\'?\\s*-?)*\"\\s*width=\"\\d*\"\\s*height=\"\\d*\">\\s*(%s)\\s*-\\s*(\\w*\\'?\\s*-?)*<\img>" % match.team1())
"width=\"\\d*\"\\s*height=\"\\d*\">\\s*(%s)\\s*-\\s*(\\w*[\\'\\.-]?\\s*)*</td>" % match.team1())
team1Rx.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
team2Rx = QRegExp(
"width=\"\\d*\"\\s*height=\"\\d*\">(\\w*[\\'\\.-]?\\s*)*-\\s*(%s)\\s*</td>" % match.team2())
team2Rx.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
else:
team1Rx = QRegExp("---deprecated---")
team2Rx = QRegExp("---deprecated---")
# team2Rx = QRegExp(match.team2())
teamXRx = team1Rx
posi = teamXRx.indexIn(strHtml)
posi2 = team2Rx.indexIn(strHtml)
#if posi < 0:
#print "-1-%s- not found" % match.team1()
#teamXRx = team2Rx
#posi = teamXRx.indexIn(strHtml)
#if (posi >= 0) and (posi2 >= 0):
if (posi >= 0) and (posi2 == posi):
print "-%s- found" % ''.join((match.team1(), " vs " + match.team2()))
else: # try in an other way
print "-%s- not found, try another way" % ''.join((match.team1(), " vs " + match.team2()))
# split team names
team1list = match.team1().split(" ")
team2list = match.team2().split(" ")
# find the longest
maxLen = 0
miniTeam1 = ""
for elt1 in team1list:
if len(elt1) > maxLen:
maxLen = len(elt1)
miniTeam1 = filter(onlyascii, elt1)
maxLen = 0
miniTeam2 = ""
for elt2 in team2list:
if len(elt2) > maxLen:
maxLen = len(elt2)
miniTeam2 = filter(onlyascii, elt2)
print "Try with {0} vs {1}".format(miniTeam1, miniTeam2)
if source == BETEXPLORER_SOURCE and not deprecated:
teamRx = QRegExp(
"><span>\\s*(\\w*\\'?\\s*-?)*{0}(\\w*\\'?\\s*-?)*</span>\\s*-\\s*<span>(\\w*\\'?\\s*-?)*{1}(\\w*\\'?\\s*-?)*</span><".format(
miniTeam1, miniTeam2))
elif source == ZULUBET_SOURCE:
#teamRx = QRegExp(
#"<img\\s*src=\"http://www\.zulubet\.com/flags/flag-\\w*\.png\"\\s*class=\"flags\\s*flag-\\w*\"\\s*title=\"(\\w*\\'?\\s*-?)*,(\\w*\\'?\\s*-?)*\"\\s*width=\"\\d*\"\\s*height=\"\\d*\">(\\w*\\'?\\s*-?)*{0}(\\w*\\'?\\s*-?)*-(\\w*\\'?\\s*-?)*{1}(\\w*\\'?\\s*-?)*<\img>".format(
#miniTeam1, miniTeam2))
teamRx = QRegExp("\">(\\w*\\'?\\s*-?)*{0}(\\w*\\'?\\s*-?)*-(\\w*\\'?\\s*-?)*{1}(\\w*\\'?\\s*-?)*</td>".format(miniTeam1, miniTeam2))
else:
teamRx = QRegExp("---deprecated---")
print "---GRID DEPRECATED---"
teamRx.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
posi = teamRx.indexIn(strHtml)
if posi >= 0:
print "found : {0} vs {1}".format(miniTeam1, miniTeam2)
else:
print "still not found :'("
# print "Odds handling KO %s not found" % str(match)
if posi >= 0:
print "posi = %d" % posi
posi = oddsRx.indexIn(strHtml, posi)
oddStr1 = oddsRx.cap(1)
oddStr2 = oddsRx.cap(2)
oddStr3 = oddsRx.cap(3)
print "read odds1 = %s" % oddStr1
try:
match.setCotes(float(oddsRx.cap(1)), float(oddsRx.cap(2)), float(oddsRx.cap(3)))
team1 = filter(onlyascii, match.team1())
team2 = filter(onlyascii, match.team2())
print "Odds handling OK : %s" % team1 + " vs " + team2
print "Odds handling OK : "
match.setCotesDisponibles(True)
#.........这里部分代码省略.........