def getRevision(self): """ Extracts the SVN revision out of the provided "svn info" output. """ self._retrieveMetaInfo() Any.requireIsInt(self._revFromInfo) return self._revFromInfo
def getSQLevelIndex(self): name = self.getSQLevelName() Any.requireIsTextNonEmpty(name) index = CheckRoutine.sqLevelNames.index(name) Any.requireIsInt(index) return index
def _toggleCombo( self ): index = self._desiredLevelCombo.currentIndex() Any.requireIsInt( index ) text = self._desiredLevelCombo.currentText() Any.requireIsTextNonEmpty( text ) sqLevel = CheckRoutine.sqLevelNames[ index ] Any.requireIsTextNonEmpty( sqLevel ) logging.debug( 'changed desired level to level=%s ("%s")', sqLevel, text ) self._preselectCheckboxes( sqLevel )
def _saveSettings( self ): logging.info( 'saving settings' ) index = self._desiredLevelCombo.currentIndex() Any.requireIsInt( index ) self._desiredLevelIndex = index name = CheckRoutine.sqLevelNames[ index ] Any.requireIsTextNonEmpty( name ) self._desiredLevelName = name self._saveSettings_level() self._saveSettings_optInOut() self._saveSettings_comments() self._dirty = False self.setWindowTitle( self._windowTitle )
def _setCellColorCode(self, child, column, status): Any.requireIsInstance(child, QTreeWidgetItem) Any.requireIsInt(column) if status is None: color = self._grey text = '' elif status is True: color = self._green text = 'yes' elif status is False: color = self._red text = 'no' else: raise ValueError('unexpected status: %s', status) child.setBackground(column, color) child.setText(column, text) child.setTextAlignment(column, Qt.AlignCenter)
# a good guess url = ProjectProperties.guessSVNLocation(package) # strip-off the version from the URL to fetch entire repository (if requested) if fetchAll: url = os.path.dirname(url) Any.requireIsTextNonEmpty(url) # revision to fetch if args['global']: try: revision = PkgInfo.getSVNRevision(package) Any.requireIsInt(revision) Any.require(revision != -1) logging.info('SVN revision = %d' % revision) except (AssertionError, IOError): logging.error('') logging.error('unable to detect last globally installed revision') logging.error('falling back to HEAD revision') logging.error('') projectName = ProjectProperties.splitPath(package)[1] Any.requireIsTextNonEmpty(projectName) # create directory with name of package when downloading a particular version, # and cd into it if not fetchAll: