rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.Debug(loc) | self.DebugErr(loc) | def lookup_yahoo(self, word): connect = httplib.HTTPConnection('cn.yahoo.com', 80) w = word.encode("GBK") # better than error connect.request("GET", "/dictionary/result/%s/%s.html" % (w[0], w)) response = connect.getresponse() if response.status != 200: msg = "%d:%s" % (response.status, response.reason) loc = response.... |
self.Debug(e) | self.DebugErr(e) | def handler(self, **args): |
self.Debug(e) | self.DebugErr(e) | def handler(self, **args): target = self.return_to_sender(args) self.version = ['oldstable', 'stable', 'testing', 'unstable'] request = args["text"].split()[2:] if request[0] in self.version: self.version = request[0] del request[0] else: self.version = "testing" if len(request) != 1: msg = "Usage: debfile [oldstable|... |
self.Debug(result) | def handler(self, **args): bot = args["ref"]() try: self.getKey(bot) except ValueError: return Event("privmsg", "", self.return_to_sender(args), [ u"ohloh key not configured" ]) | |
translated = response.read().decode("UTF-8", "ignore") if translated[0] == '"': return translated[1:-1] elif translated[0] == '[': return translated[1:-1].replace(',', ' ').replace('"', '').replace('[', '(').replace(']', ')') else: return translated | translated = json.loads(response.read().decode("UTF-8", "ignore").replace(']],,"', ']],[],"')) result = translated[0][0] return result[0] + ' ' + result[2] | def translate(self, text, fromLang, toLang, fromLanguage, toLanguage): if fromLang not in self.supportedTranslations or toLang not in self.supportedTranslations: return |
def encode(input): return (urllib.quote(input), len(input)) | def url_encode(input): output = urllib.quote(input) return (output, len(output)) | def encode(input): return (urllib.quote(input), len(input)) |
def decode(input): return (urllib.unquote(input), len(input)) | def url_decode(input): output = urllib.unquote(input) return (output, len(output)) | def decode(input): return (urllib.unquote(input), len(input)) |
return (urllib.quote_plus(input), len(input)) | output = urllib.quote_plus(input) return (output, len(output)) | def encode_plus(input): return (urllib.quote_plus(input), len(input)) |
return (urllib.unquote_plus(input), len(input)) | output = urllib.unquote_plus(input) return (output, len(output)) | def decode_plus(input): return (urllib.unquote_plus(input), len(input)) |
return encode(input, errors) | return url_encode(input, errors) | def encode(self, input, errors='strict'): return encode(input, errors) |
return decode(input, errors) | return url_decode(input, errors) | def decode(self, input, errors='strict'): return decode(input, errors) |
LEFT JOIN chan ON chan.chanid=url.nickid | LEFT JOIN chan ON chan.chanid=url.chanid | def handler(self, **args): """Looks for urls in each line of text.""" |
import irclib irclib.DebugErr(result) | def translate(self, text, fromLang, toLang, fromLanguage, toLanguage): if fromLang not in self.supportedTranslations or toLang not in self.supportedTranslations: return | |
icon = QIcon(":/images/rluu/triangleRuler.png") | icon = QIcon(":/images/tango-icon-theme-0.8.90/32x32/categories/applications-system.png") | def _createActions(self): """Creates all the QAction objects that will be mapped to the choices on the menu, toolbar and keyboard shortcuts.""" |
self.priceBarChartScalings = priceBarChartScalings | self.priceBarChartScalings = list(priceBarChartScalings) | def __init__(self, priceBarChartScalings=[], priceBarChartScalingsIndex=-1, parent=None): """Initializes the edit widget with the given values. |
self.loadScalings(self.priceBarChartScalings, self.priceBarChartScalingsIndex) | def __init__(self, priceBarChartScalings=[], priceBarChartScalingsIndex=-1, parent=None): """Initializes the edit widget with the given values. | |
listWidgetItem = QListWidgetItem() scalingStr = scaling.name + \ " (sx={}, sy={})".format(scaling.getSx(), scaling.getSy()) listWidgetItem.setText(scalingStr) self.listWidget.addItem(listWidgetItem) | self._appendScalingAsListWidgetItem(scaling, False) index = self.priceBarChartScalingsIndex if index >= 0 and index < len(self.priceBarChartScalings): self.listWidget.setCurrentRow(index) currentScaling = self.priceBarChartScalings[index] self.currentScalingNameValueLabel.\ setText(currentScaling.name) self.cu... | def loadScalings(self, priceBarChartScalings, priceBarChartScalingsIndex): """Loads the widgets with values from the given arguments. |
"""Saves the values in the widgets to the PriceBarChartScaling object passed in this class's constructor. | """Ensures the values in the widgets are saved to their underlying variables, such that subsequent calls to getPriceBarChartScalings() and getPriceBarChartScalingsIndex() will return valid values for what has changed. | def saveScalings(self): """Saves the values in the widgets to the PriceBarChartScaling object passed in this class's constructor. """ self.log.debug("Entered saveScaling()") |
index = self.listWidget.currentRow() if index >= 0 and index < len(self.priceBarChartScalings): self.listWidget.setCurrentRow(index) selectedScaling = self.priceBarChartScalings[index] currentScaling = self.priceBarChartScalings[index] self.selectedScalingNameValueLabel.\ setText(selectedScaling.name) self.sele... | def _handleScalingSelected(self): """Called when a scaling is selected in the QListWidget. This will update the QLabels to tell the user the properties of what is selected. """ | |
scaling = PriceBarChartScaling() dialog = PriceBarChartScalingEditDialog(scaling) if dialog.exec_() == QDialog.Accepted: self.priceBarChartScalings.append(scaling) self._appendScalingAsListWidgetItem(scaling, True) | def _handleAddScalingButtonClicked(self): """Called when the 'Add Scaling' button is clicked.""" | |
row = self.listWidget.currentRow() if row >= 0 and row < self.listWidget.count(): self.listWidget.takeItem(row) if self.listWidget.item(row) != None: self.listWidget.setCurrentRow(row) else: if row != 0: self.listWidget.setCurrentRow(row - 1) self.priceBarChartScalings.pop(row) if self.priceBarCha... | def _handleRemoveScalingButtonClicked(self): """Called when the 'Remove Scaling' button is clicked.""" | |
row = self.listWidget.currentRow() scaling = self.priceBarChartScalings[row] dialog = PriceBarChartScalingEditDialog(scaling) if dialog.exec_() == QDialog.Accepted: self.priceBarChartScalings[row] = scaling self._handleScalingSelected() | def _handleEditScalingButtonClicked(self): """Called when the 'Edit Scaling' button is clicked.""" | |
row = self.listWidget.currentRow() if row > 0: currItem = self.listWidget.takeItem(row) self.listWidget.insertItem(row - 1, currItem) if self.priceBarChartScalingsIndex == row: self.priceBarChartScalingsIndex -= 1 elif self.priceBarChartScalingsIndex == row - 1: self.priceBarChartScalingsIndex += 1 self.listW... | def _handleMoveScalingUpButtonClicked(self): """Called when the 'Move scaling up' button is clicked.""" | |
row = self.listWidget.currentRow() if row < len(self.listWidget.count()) - 1 and row >= 0: currItem = self.listWidget.takeItem(row) self.listWidget.insertItem(row + 1, currItem) if self.priceBarChartScalingsIndex == row: self.priceBarChartScalingsIndex += 1 elif self.priceBarChartScalingsIndex == row + 1: self.... | def _handleMoveScalingDownButtonClicked(self): """Called when the 'Move scaling down' button is clicked.""" | |
row = self.listWidget.currentRow() self.priceBarChartScalingsIndex = row currentScaling = self.priceBarChartScalings[row] self.currentScalingNameValueLabel.\ setText(currentScaling.name) self.currentScalingDescriptionValueLabel.\ setText(currentScaling.description) self.currentScalingUnitsOfTimeValueLabel.\ setTe... | def _handleSetSelectedAsCurrentButtonClicked(self): """Called when the 'Set selected scaling as current' button is clicked. This will update the QLabels to tell the user the properties of what is selected as being the currently applied scaling. """ | |
self.graphicsScene.addItem(item) | def loadDayPriceBars(self, priceBars): """Loads the given PriceBars list into this widget as PriceBarGraphicsItems. """ self.log.debug("Entered loadDayPriceBars({} pricebars)".\ format(len(priceBars))) | |
self.penWidth = 1.0 | self.penWidth = 0.0 | def __init__(self, parent=None, scene=None): # Logger self.log = logging.getLogger("pricebarchart.PriceBarGraphicsItem") self.log.debug("Entered __init__().") |
self.boldPenWidth = 2.0 | self.boldPenWidth = 0.2 | def __init__(self, parent=None, scene=None): # Logger self.log = logging.getLogger("pricebarchart.PriceBarGraphicsItem") self.log.debug("Entered __init__().") |
self.leftExtensionWidth = 1.0 self.stemWidth = 1.0 | self.leftExtensionWidth = 0.5 | def __init__(self, parent=None, scene=None): # Logger self.log = logging.getLogger("pricebarchart.PriceBarGraphicsItem") self.log.debug("Entered __init__().") |
self.rightExtensionWidth = 1.0 | self.rightExtensionWidth = 0.5 | def __init__(self, parent=None, scene=None): # Logger self.log = logging.getLogger("pricebarchart.PriceBarGraphicsItem") self.log.debug("Entered __init__().") |
self.log.debug("Entered boundingRect().") | def boundingRect(self): """Returns the bounding rectangle for this graphicsitem.""" | |
y = 1.0 * ((priceRange / 2.0) + halfPenWidth) | y = -1.0 * ((priceRange / 2.0) + halfPenWidth) | def boundingRect(self): """Returns the bounding rectangle for this graphicsitem.""" |
self.stemWidth + \ | def boundingRect(self): """Returns the bounding rectangle for this graphicsitem.""" | |
self.log.debug("Leaving boundingRect().") | def boundingRect(self): """Returns the bounding rectangle for this graphicsitem.""" | |
self.log.debug("Entered paint()") | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ | |
self.log.debug("DEBUG: open={}, high={}, low={}, close={}".\ format(open, high, low, close)) | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ | |
self.log.debug("DEBUG: priceRange={}".format(priceRange)) | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ | |
self.log.debug("DEBUG: priceMidpoint={}".format(priceMidpoint)) | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ | |
self.log.debug("DEBUG: line being drawn: ({}, {}, {}, {})".\ format(x1, y1, x2, y2)) painter.drawLine(x1, y1, x2, y2) self.log.debug("DEBUG: this item's pos is: ({}, {})".\ format(self.x(), self.y())) | painter.drawLine(QLineF(x1, y1, x2, y2)) | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ |
painter.drawLine(x1, y1, x2, y2) | painter.drawLine(QLineF(x1, y1, x2, y2)) | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ |
painter.drawLine(x1, y1, x2, y2) self.log.debug("Leaving paint()") | painter.drawLine(QLineF(x1, y1, x2, y2)) | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ |
self.penWidth = 1.0 | self.penWidth = 0.0 | def __init__(self, parent=None, scene=None): super().__init__(parent, scene) |
self.boldPenWidth = 2.0 | self.boldPenWidth = 0.0 | def __init__(self, parent=None, scene=None): super().__init__(parent, scene) |
self.leftExtensionWidth = 1.0 self.stemWidth = 1.0 | self.leftExtensionWidth = 0.5 | def __init__(self, parent=None, scene=None): super().__init__(parent, scene) |
self.rightExtensionWidth = 1.0 | self.rightExtensionWidth = 0.5 | def __init__(self, parent=None, scene=None): super().__init__(parent, scene) |
self.stemWidth = 7.0 | def __init__(self, parent=None, scene=None): super().__init__(parent, scene) | |
pixmap = QPixMap(":/images/rluu/zoomIn.png") | pixmap = QPixmap(":/images/rluu/zoomIn.png") | def enterEvent(self, qevent): """Overwrites the QWidget.enterEvent() function. |
pixmap = QPixMap(":/images/rluu/zoomOut.png") | pixmap = QPixmap(":/images/rluu/zoomOut.png") | def enterEvent(self, qevent): """Overwrites the QWidget.enterEvent() function. |
pixmap = QPixMap(":/images/rluu/zoomIn.png") | pixmap = QPixmap(":/images/rluu/zoomIn.png") | def toZoomInToolMode(self): """Changes the tool mode to be the ZoomInTool.""" |
pixmap = QPixMap(":/images/rluu/zoomOut.png") | pixmap = QPixmap(":/images/rluu/zoomOut.png") | def toZoomOutToolMode(self): """Changes the tool mode to be the ZoomOutTool.""" |
db.delete(comments) | MukioTools.delete(comments) | def delete_video_by_key_name(keyname): v = Video.get_by_key_name(keyname) if v: comments = v.comment_set db.delete(comments) cblocks = v.cblock_set db.delete(cblocks)# 新,删永久xml |
db.delete(cblocks) | MukioTools.delete(cblocks) | def delete_video_by_key_name(keyname): v = Video.get_by_key_name(keyname) if v: comments = v.comment_set db.delete(comments) cblocks = v.cblock_set db.delete(cblocks)# 新,删永久xml |
db.delete(comments) | MukioTools.delete(comments) | def delete_comment_by_video_key_name(keyname): v = Video.get_by_key_name(keyname) if v: comments = v.comment_set db.delete(comments) |
db.delete(cblocks) | MukioTools.delete(cblocks) | def delete_permanent_comment_by_video_key_name(keyname): v = Video.get_by_key_name(keyname) if v: cblocks = v.cblock_set db.delete(cblocks) |
_set (self, "properties", schema.MandatoryProperties + schema.OptionalProperties) _set (self, "is_container", schema.Container) | _set (self, "properties", getattr (schema, "MandatoryProperties", []) + getattr (schema, "OptionalProperties", [])) _set (self, "is_container", getattr (schema, "Container", False)) | def __init__ (self, obj): # # Be careful here with attribute assignment; # __setattr__ & __getattr__ will fall over # each other if you aren't. # _set (self, "com_object", obj) schema = GetObject (obj.Schema) _set (self, "properties", schema.MandatoryProperties + schema.OptionalProperties) _set (self, "is_container",... |
log('===================================',True,True) | log('===============================',True,True) | def finishedDownload(self): log('Finished Download',True,True) log('===================================',True,True) self.btnCancel.Disable() self.btnDownload.Enable() self.updateProgressBar(0) |
log('Processing display %s' % name) | log('Processing Display %s' % name, True, True) | def run(self): self.__running = True |
tSize = 0 | tSize = 0.00000001 | def run(self): self.__running = True |
"abbr": "%s" | "state": "%s" | def writeJSON( path, type, abbr, suffix, json ): file = 'json/%s%s.json' %( abbr, suffix ) print 'Writing %s' % file types = [] for t in json: types.append( '\n\t\t%s\n\t\t' %( ',\n\t\t'.join(json[t]) ) ) writeFile( file, |
if type == "state": abbr = '"abbr":"%s",' % state else: abbr = '' return '{"type":"Feature","bbox":[%.4f,%.4f,%.4f,%.4f],"properties":{"kind":"%s",%s"name":"%s","center":[%.4f,%.4f],"centroid":[%.4f,%.4f]},"geometry":{"type":"MultiPolygon","coordinates":[%s]}}' %( | return '{"type":"Feature","bbox":[%.4f,%.4f,%.4f,%.4f],"properties":{"kind":"%s","name":"%s","state":"%s","center":[%.4f,%.4f],"centroid":[%.4f,%.4f]},"geometry":{"type":"MultiPolygon","coordinates":[%s]}}' %( | def getPlaceJSON( places, key, state, type ): place = places[key] if not place: return '' bounds = place['bounds'] center = place['center'] centroid = place['centroid'] if type == "state": abbr = '"abbr":"%s",' % state else: abbr = '' return '{"type":"Feature","bbox":[%.4f,%.4f,%.4f,%.4f],"properties":{"kind":"%s",%s"n... |
type, abbr, key.split(keysep)[2], | type, key.split(keysep)[2], state, | def getPlaceJSON( places, key, state, type ): place = places[key] if not place: return '' bounds = place['bounds'] center = place['center'] centroid = place['centroid'] if type == "state": abbr = '"abbr":"%s",' % state else: abbr = '' return '{"type":"Feature","bbox":[%.4f,%.4f,%.4f,%.4f],"properties":{"kind":"%s",%s"n... |
self._itdb_file = os.path.join(self._itdb.mountpoint, "iPod_Control","iTunes","iTunesDB") | self._itdb_file = gpod.itdb_get_itunesdb_path( gpod.itdb_get_mountpoint(self._itdb) ) | def __init__(self, mountpoint="/mnt/ipod", local=False, localdb=None): """Create a Database object. |
if not gpod.itdb_write_file(self._itdb, self._itdb_file, None): | if not gpod.itdb_write(self._itdb, None): | def close(self): """Save and close the database. |
if gpod.itdb_get_mountpoint(self._itdb): if not gpod.itdb_shuffle_write(self._itdb, None): raise DatabaseException("Unable to save shuffle database on %s" % self._itdb.mountpoint) | def close(self): """Save and close the database. | |
self.assertRaises(Exception, test_view('calendar_scheduling')) | test_view('calendar_scheduling') | def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('calendar_scheduling')) |
directory = QtGui.QFileDialog.getExistingDirectory(self, u'Open Directory') | signatureFilePath = os.path.expanduser("~")+"/Desktop/"+"apt-offline.sig" directory = QtGui.QFileDialog.getSaveFileName(self, u'Select a filename to save the signature', signatureFilePath, "apt-offline Signatures (*.sig)") | def popupDirectoryDialog(self): # Popup a Directory selection box directory = QtGui.QFileDialog.getExistingDirectory(self, u'Open Directory') # Show the selected file path in the field marked for showing directory path self.ui.profileFilePath.setText(directory) |
shutil.copy2(filename, Str_InstallSrcPath) | shutil.copy2(FullFileName, Str_InstallSrcPath) | def DirInstallPackages(InstallDirPath): for eachfile in os.listdir( InstallDirPath ): filename = eachfile FullFileName = os.path.abspath(os.path.join(InstallDirPath, eachfile) ) #INFO: Take care of Src Pkgs found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is Tr... |
elif HashType == "md5": | elif HashType == "md5" or HashType == "md5sum": | def HashMessageDigestAlgorithms( self, checksum, HashType, file ): data = open( file, 'rb' ) if HashType == "sha256": Hash = self.sha256( data ) elif HashType == "md5": Hash = self.md5( data ) else: Hash = None data.close() if Hash == checksum: return True return False |
hash = hashlib.md5.new() | hash = hashlib.md5() | def md5( self, data ): hash = hashlib.md5.new() hash.update( data.read() ) return hash.hexdigest() |
if os.path.isfile(self.filepath): | if os.path.exists(self.zipfilepath): | def StartDownload(self): # Do all the download related work here and then close |
self.packageList = self.ui.packageList.text().split(",") | self.packageList = str(self.ui.packageList.text()).split(",") | def CreateProfile(self): # Is the Update requested self.updateChecked = self.ui.updateCheckBox.isChecked() # Is Upgrade requested self.upgradeChecked = self.ui.upgradePackagesRadioBox.isChecked() # Is Install Requested self.installChecked = self.ui.installPackagesRadioBox.isChecked() |
os.environ['__apt_set_install_release'] = self.WriteTo | os.environ['__apt_set_install_release'] = self.ReleaseType | def __AptInstallSrcPackages(self, SrcPackageList=None, ReleaseType=None, BuildDependency=False): self.package_list = '' self.ReleaseType = ReleaseType for pkg in SrcPackageList: self.package_list += pkg + ', ' log.msg( "\nGenerating database of source packages %s.\n" % (self.package_list) ) os.environ['__apt_set_ins... |
checksum = string.rstrip(string.lstrip(''.join(item[3]), chars = "'"), chars = "'") checksum = string.rstrip(checksum, chars = "\n") | try: checksum = string.rstrip(string.lstrip(''.join(item[3]), chars = "'"), chars = "'") checksum = string.rstrip(checksum, chars = "\n") except IndexError: if item[1].endswith("_Release") or item[1].endswith("_Release.gpg"): checksum = None | def stripper(item): '''Strips extra characters from "item". Breaks "item" into: url - The URL file - The actual package file size - The file size checksum - The checksum string and returns them.''' item = item.split(' ') log.verbose("Item is %s\n" % (item) ) url = string.rstrip(string.lstrip(''.join(item[0]), chars="... |
bug_fetched = 0 | def abc(request, response, func=find_first_match): '''Get items from the request Queue, process them with func(), put the results along with the Thread's name into the response Queue. Stop running when item is None.''' #while 1: #tuple_item_key = request.get() #if tuple_item_key is None: # break #(key, item) = t... | |
bug_fetched = 1 | bug_fetched = True | def abc(request, response, func=find_first_match): '''Get items from the request Queue, process them with func(), put the results along with the Thread's name into the response Queue. Stop running when item is None.''' #while 1: #tuple_item_key = request.get() #if tuple_item_key is None: # break #(key, item) = t... |
if bug_fetched == 1: | if bug_fetched is True: | def abc(request, response, func=find_first_match): '''Get items from the request Queue, process them with func(), put the results along with the Thread's name into the response Queue. Stop running when item is None.''' #while 1: #tuple_item_key = request.get() #if tuple_item_key is None: # break #(key, item) = t... |
def DirInstallPackages(InstallDirPath): for eachfile in os.listdir( InstallDirPath ): filename = eachfile FullFileName = os.path.abspath(os.path.join(InstallDirPath, eachfile) ) found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is True: shutil.copy2(filename, S... | def magic_check_and_uncompress( archive_file=None, filename=None): retval = False if AptOfflineMagicLib.file( archive_file ) == "application/x-bzip2" or \ AptOfflineMagicLib.file( archive_file ) == "application/x-gzip": temp_filename = os.path.join(apt_update_target_path, filename + app_name) filename = os.path.join(ap... | |
DirInstallPackages(install_file_path) | for eachfile in os.listdir( install_file_path ): filename = eachfile FullFileName = os.path.abspath(os.path.join(install_file_path, eachfile) ) found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is True: shutil.copy2(filename, Str_InstallSrcPath) log.msg("Instal... | def DirInstallPackages(InstallDirPath): for eachfile in os.listdir( InstallDirPath ): filename = eachfile FullFileName = os.path.abspath(os.path.join(InstallDirPath, eachfile) ) #INFO: Take care of Src Pkgs found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is Tr... |
DirInstallPackages(install_file_path) | for eachfile in os.listdir( install_file_path ): filename = eachfile eachfile = os.path.abspath(os.path.join(install_file_path, eachfile) ) found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is True: shutil.copy2(eachfile, Str_InstallSrcPath) log.msg("Installed s... | def DirInstallPackages(InstallDirPath): for eachfile in os.listdir( InstallDirPath ): filename = eachfile FullFileName = os.path.abspath(os.path.join(InstallDirPath, eachfile) ) #INFO: Take care of Src Pkgs found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is Tr... |
shutil.move(x, Str_DownloadDir) | try: shutil.move(x, Str_DownloadDir) except: log.verbose("Exception thrown. Most likely it is because the cache_dir and download_dir locations are the same.\n") | def DataFetcher(request, response, func=find_first_match): '''Get items from the request Queue, process them with func(), put the results along with the Thread's name into the response Queue. Stop running when item is None.''' #while 1: #tuple_item_key = request.get() #if tuple_item_key is None: # break #(key, i... |
for eachfile in os.listdir( install_file_path ): filename = eachfile FullFileName = os.path.abspath(os.path.join(install_file_path, eachfile) ) found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is True: shutil.copy2(filename, Str_InstallSrcPath) log.msg("Instal... | DirInstallPackages(install_file_path) | def magic_check_and_uncompress( archive_file=None, filename=None): retval = False if AptOfflineMagicLib.file( archive_file ) == "application/x-bzip2" or \ AptOfflineMagicLib.file( archive_file ) == "application/x-gzip": temp_filename = os.path.join(apt_update_target_path, filename + app_name) filename = os.path.join(ap... |
for eachfile in os.listdir( install_file_path ): filename = eachfile eachfile = os.path.abspath(os.path.join(install_file_path, eachfile) ) found = False for item in SrcPkgDict.keys(): if filename in SrcPkgDict[item]: found = True break if found is True: shutil.copy2(eachfile, Str_InstallSrcPath) log.msg("Installed s... | DirInstallPackages(install_file_path) | def magic_check_and_uncompress( archive_file=None, filename=None): retval = False if AptOfflineMagicLib.file( archive_file ) == "application/x-bzip2" or \ AptOfflineMagicLib.file( archive_file ) == "application/x-gzip": temp_filename = os.path.join(apt_update_target_path, filename + app_name) filename = os.path.join(ap... |
CreateProfile.resize(420, 368) | CreateProfile.resize(443, 374) | def setupUi(self, CreateProfile): CreateProfile.setObjectName("CreateProfile") CreateProfile.resize(420, 368) self.verticalLayoutWidget = QtGui.QWidget(CreateProfile) self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 401, 309)) self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") self.verticalLayout... |
self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 401, 309)) | self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 427, 321)) | def setupUi(self, CreateProfile): CreateProfile.setObjectName("CreateProfile") CreateProfile.resize(420, 368) self.verticalLayoutWidget = QtGui.QWidget(CreateProfile) self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 401, 309)) self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") self.verticalLayout... |
spacerItem = QtGui.QSpacerItem(150, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) | spacerItem = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | def setupUi(self, CreateProfile): CreateProfile.setObjectName("CreateProfile") CreateProfile.resize(420, 368) self.verticalLayoutWidget = QtGui.QWidget(CreateProfile) self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 401, 309)) self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") self.verticalLayout... |
progress = args.progress_bar progressLabel = args.progress_label FetcherInstance = QtFetcherClass(progress=progress, progressLabel=progressLabel, lock=True, total_items=total_items ) | FetcherInstance = QtFetcherClass(progress_bar=args.progress, progress_label=args.progress_label, lock=True, total_items=total_items ) | def __init__( self, progress_bar, progress_label ,lock, total_items ): QtDownloadFromWeb.__init__( self, progressbar=progress_bar, label=progress_label, total_items=total_items ) #ProgressBar.__init__(self, width) #self.width = width AptOfflineLib.Archiver.__init__( self, lock=lock ) #self.lock = lock |
self.menubar.setGeometry(QtCore.QRect(0, 0, 432, 20)) | self.menubar.setGeometry(QtCore.QRect(0, 0, 432, 25)) | def setupUi(self, AptOfflineMain): AptOfflineMain.setObjectName("AptOfflineMain") AptOfflineMain.resize(432, 544) AptOfflineMain.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) AptOfflineMain.setUnifiedTitleAndToolBarOnMac(True) self.centralwidget = QtGui.QWidget(AptOfflineMain) self.centralwidget.setObjectName("centr... |
elif filename.endswith( apt_bug_file_format ): retval = False | def magic_check_and_uncompress( archive_file=None, filename=None): retval = False if AptOfflineMagicLib.file( archive_file ) == "application/x-bzip2" or \ AptOfflineMagicLib.file( archive_file ) == "application/x-gzip": temp_filename = os.path.join(apt_update_target_path, filename + app_name) filename = os.path.join(ap... | |
else: log.err("Failed to sync %s\n" % (filename) ) | def magic_check_and_uncompress( archive_file=None, filename=None): retval = False if AptOfflineMagicLib.file( archive_file ) == "application/x-bzip2" or \ AptOfflineMagicLib.file( archive_file ) == "application/x-gzip": temp_filename = os.path.join(apt_update_target_path, filename + app_name) filename = os.path.join(ap... | |
archive_type = None magic_check_and_uncompress( archive_file, filename ) | magic_check_and_uncompress( FullFileName, filename ) sys.exit(0) | def magic_check_and_uncompress( archive_file=None, filename=None): retval = False if AptOfflineMagicLib.file( archive_file ) == "application/x-bzip2" or \ AptOfflineMagicLib.file( archive_file ) == "application/x-gzip": temp_filename = os.path.join(apt_update_target_path, filename + app_name) filename = os.path.join(ap... |
for each_bug in dictList.keys(): | sortedKeyList = dictList.keys() sortedKeyList.sort() for each_bug in sortedKeyList: pkg_name = each_bug.split( '.' )[-3].split('/')[-1] | def list_bugs(dictList): ''' Takes a dictionary of key,value pair where: key => filename value => subject string ''' log.msg( "\n\nFollowing are the list of bugs present.\n" ) for each_bug in dictList.keys(): bug_num = each_bug.split( '.' )[-2] bug_subject = dictList[each_bug] log.msg( "%s\t%s\n" % ( bug_num, bug_subje... |
log.msg( "%s\t%s\n" % ( bug_num, bug_subject ) ) | log.msg( "%s\t%s\t\t%s\n" % ( bug_num, pkg_name, bug_subject ) ) | def list_bugs(dictList): ''' Takes a dictionary of key,value pair where: key => filename value => subject string ''' log.msg( "\n\nFollowing are the list of bugs present.\n" ) for each_bug in dictList.keys(): bug_num = each_bug.split( '.' )[-2] bug_subject = dictList[each_bug] log.msg( "%s\t%s\n" % ( bug_num, bug_subje... |
self.statusProgressBar.setProperty("value", 0) | self.statusProgressBar.setProperty("value", QtCore.QVariant(0)) | def setupUi(self, AptOfflineQtFetch): AptOfflineQtFetch.setObjectName("AptOfflineQtFetch") AptOfflineQtFetch.setWindowModality(QtCore.Qt.WindowModal) AptOfflineQtFetch.resize(466, 454) self.profileFilePath = QtGui.QLineEdit(AptOfflineQtFetch) self.profileFilePath.setGeometry(QtCore.QRect(30, 60, 270, 30)) self.profileF... |
CRON_KEY = "X-AppEngine-Cron" | def get_page(self): data = {} return render_to_response(self.get_page_template(), data, RequestContext(self.request)) | |
def is_cron(self, data_dict): value = data_dict.get(self.CRON_KEY) logging.info("Checking cron key: %s = %s" % (self.CRON_KEY, value)) return bool(value) | def check_cron(self): """ Checks whether the incoming request is a cron request. This function firstly checks the request headers for AppEngine's cron key, to see if it's a scheduled cron request. If not present, it checks the request's GET dict to see if it's a manual cron request. According to Django's documentation... | def is_cron(self, data_dict): value = data_dict.get(self.CRON_KEY) logging.info("Checking cron key: %s = %s" % (self.CRON_KEY, value)) return bool(value) |
if self.is_cron(self.request.META): is_cron_request, is_scheduled = True, True logging.info("About to run scheduled cron job %s..." % self.get_job_title()) elif self.is_cron(self.request.GET): is_cron_request, is_scheduled = True, False logging.info("About to run cron job %s manually..." % self.get_job_title()) else: i... | is_cron_request, is_scheduled = self.check_cron() | def get_page(self): # Check if the incoming request is a cron request. if self.is_cron(self.request.META): is_cron_request, is_scheduled = True, True logging.info("About to run scheduled cron job %s..." % self.get_job_title()) elif self.is_cron(self.request.GET): is_cron_request, is_scheduled = True, False logging.info... |
else: prompt = None | def get_page(self): # Check if the incoming request is a cron request. if self.is_cron(self.request.META): is_cron_request, is_scheduled = True, True logging.info("About to run scheduled cron job %s..." % self.get_job_title()) elif self.is_cron(self.request.GET): is_cron_request, is_scheduled = True, False logging.info... | |
"cron_key": self.CRON_KEY, | def get_page(self): # Check if the incoming request is a cron request. if self.is_cron(self.request.META): is_cron_request, is_scheduled = True, True logging.info("About to run scheduled cron job %s..." % self.get_job_title()) elif self.is_cron(self.request.GET): is_cron_request, is_scheduled = True, False logging.info... | |
return cls(key_name=pk, user=user, **kwargs) | name = kwargs.get("name") if "name" in kwargs: del kwargs["name"] instance = cls(key_name=pk, user=user, **kwargs) instance.name = name return instance | def create(cls, user, **kwargs): pk = cls._make_pk(user) return cls(key_name=pk, user=user, **kwargs) |
self._user = users.get_user(username) | self._username = username self._user = users.get_user(username, create=False) | def __init__(self, request, username): super(BaseProfileAction, self).__init__(request) self._user = users.get_user(username) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.