diff -r 3d88d53f8c2b -r 033967644b1f Project/Project.py --- a/Project/Project.py Thu Mar 09 19:28:59 2017 +0100 +++ b/Project/Project.py Fri Mar 10 17:32:19 2017 +0100 @@ -784,11 +784,11 @@ # create hash value, if it doesn't have one if reader.version.startswith("5.") and not self.pdata["HASH"]: - hash = str(QCryptographicHash.hash( + hashStr = str(QCryptographicHash.hash( QByteArray(self.ppath.encode("utf-8")), QCryptographicHash.Sha1).toHex(), encoding="utf-8") - self.pdata["HASH"] = hash + self.pdata["HASH"] = hashStr self.setDirty(True) return res @@ -811,11 +811,11 @@ copy.deepcopy(self.vcs.vcsGetOtherData()) if not self.pdata["HASH"]: - hash = str(QCryptographicHash.hash( + hashStr = str(QCryptographicHash.hash( QByteArray(self.ppath.encode("utf-8")), QCryptographicHash.Sha1).toHex(), encoding="utf-8") - self.pdata["HASH"] = hash + self.pdata["HASH"] = hashStr if fn is None: fn = self.pfile @@ -1512,18 +1512,19 @@ self.setDirty(True) @pyqtSlot() - def addFiles(self, filter=None, startdir=None): + def addFiles(self, fileTypeFilter=None, startdir=None): """ Public slot used to add files to the project. - @param filter filter to be used by the add file dialog + @param fileTypeFilter filter to be used by the add file dialog (string out of source, form, resource, interface, others) @param startdir start directory for the selection dialog """ if startdir is None: startdir = self.ppath from .AddFileDialog import AddFileDialog - dlg = AddFileDialog(self, self.parent(), filter, startdir=startdir) + dlg = AddFileDialog(self, self.parent(), fileTypeFilter, + startdir=startdir) if dlg.exec_() == QDialog.Accepted: fnames, target, isSource = dlg.getData() if target != '': @@ -1558,7 +1559,8 @@ .format(fn, target, str(why))) continue - self.appendFile(targetfile, isSource or filter == 'source') + self.appendFile(targetfile, + isSource or fileTypeFilter == 'source') else: E5MessageBox.critical( self.ui, @@ -1661,11 +1663,11 @@ self.__addRecursiveDirectory(filetype, ns, nt) @pyqtSlot() - def addDirectory(self, filter=None, startdir=None): + def addDirectory(self, fileTypeFilter=None, startdir=None): """ Public method used to add all files of a directory to the project. - @param filter filter to be used by the add directory dialog + @param fileTypeFilter filter to be used by the add directory dialog (string out of source, form, resource, interface, others) @param startdir start directory for the selection dialog (string) """ @@ -1673,7 +1675,7 @@ startdir = self.ppath from .AddDirectoryDialog import AddDirectoryDialog dlg = AddDirectoryDialog( - self, filter, self.parent(), startdir=startdir) + self, fileTypeFilter, self.parent(), startdir=startdir) if dlg.exec_() == QDialog.Accepted: filetype, source, target, recursive = dlg.getData() if target == '': @@ -2172,11 +2174,11 @@ self.projectAboutToBeCreated.emit() - hash = str(QCryptographicHash.hash( + hashStr = str(QCryptographicHash.hash( QByteArray(self.ppath.encode("utf-8")), QCryptographicHash.Sha1).toHex(), encoding="utf-8") - self.pdata["HASH"] = hash + self.pdata["HASH"] = hashStr # create the project directory if it doesn't exist already if not os.path.isdir(self.ppath): @@ -4246,8 +4248,8 @@ newFiles = [] dirs = self.subdirs[:] - for dir in dirs: - curpath = os.path.join(self.ppath, dir) + for directory in dirs: + curpath = os.path.join(self.ppath, directory) try: newSources = os.listdir(curpath) except OSError: @@ -4271,10 +4273,10 @@ # set fn to project relative name # then reset ns to fully qualified name for insertion, # possibly. - if dir == "": + if directory == "": fn = ns else: - fn = os.path.join(dir, ns) + fn = os.path.join(directory, ns) ns = os.path.abspath(os.path.join(curpath, ns)) # do not bother with dirs here...