From 30c607ef581345958f0f9bdb5dd5603a1dd774c8 Mon Sep 17 00:00:00 2001
From: nilshah98
Date: Sun, 31 Mar 2019 04:28:27 +0530
Subject: port to python3
---
src/projManagement/openProject.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'src/projManagement/openProject.py')
diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py
index d980d914..c71d2181 100644
--- a/src/projManagement/openProject.py
+++ b/src/projManagement/openProject.py
@@ -18,7 +18,7 @@
#===============================================================================
from PyQt4 import QtGui
-from Validation import Validation
+from .Validation import Validation
from configuration.Appconfig import Appconfig
import os
import json
@@ -40,7 +40,7 @@ class OpenProjectInfo(QtGui.QWidget):
if self.obj_validation.validateOpenproj(self.projDir) == True:
self.obj_Appconfig.current_project['ProjectName'] = str(self.projDir)
if os.path.isdir(self.projDir):
- print "true"
+ print("true")
for dirs, subdirs, filelist in os.walk(self.obj_Appconfig.current_project["ProjectName"]):
directory = dirs
--
cgit
From 28d8fd378bf717e8daba8a564708856769f24b98 Mon Sep 17 00:00:00 2001
From: maddy-2
Date: Mon, 27 May 2019 12:32:49 +0530
Subject: initialise pep8 compliance, using autopep8
---
src/projManagement/openProject.py | 56 ++++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 27 deletions(-)
(limited to 'src/projManagement/openProject.py')
diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py
index c71d2181..58a6be0a 100644
--- a/src/projManagement/openProject.py
+++ b/src/projManagement/openProject.py
@@ -1,21 +1,21 @@
-#===============================================================================
+#=========================================================================
#
# FILE: openProject.py
-#
-# USAGE: ---
-#
-# DESCRIPTION: It is called whenever new project is being called.
-#
+#
+# USAGE: ---
+#
+# DESCRIPTION: It is called whenever new project is being called.
+#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Fahim Khan, fahim.elex@gmail.com
# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
-# CREATED: Wednesday 12 February 2015
+# CREATED: Wednesday 12 February 2015
# REVISION: ---
-#===============================================================================
+#=========================================================================
from PyQt4 import QtGui
from .Validation import Validation
@@ -28,45 +28,47 @@ class OpenProjectInfo(QtGui.QWidget):
"""
This class is called when User click on Open Project Button
"""
+
def __init__(self):
super(OpenProjectInfo, self).__init__()
self.obj_validation = Validation()
-
+
def body(self):
self.obj_Appconfig = Appconfig()
self.openDir = self.obj_Appconfig.default_workspace["workspace"]
- self.projDir=QtGui.QFileDialog.getExistingDirectory(self,"open",self.openDir)
-
+ self.projDir = QtGui.QFileDialog.getExistingDirectory(
+ self, "open", self.openDir)
+
if self.obj_validation.validateOpenproj(self.projDir) == True:
- self.obj_Appconfig.current_project['ProjectName'] = str(self.projDir)
+ self.obj_Appconfig.current_project['ProjectName'] = str(
+ self.projDir)
if os.path.isdir(self.projDir):
print("true")
-
- for dirs, subdirs, filelist in os.walk(self.obj_Appconfig.current_project["ProjectName"]):
+
+ for dirs, subdirs, filelist in os.walk(
+ self.obj_Appconfig.current_project["ProjectName"]):
directory = dirs
files = filelist
self.obj_Appconfig.project_explorer[dirs] = filelist
- json.dump(self.obj_Appconfig.project_explorer, open(self.obj_Appconfig.dictPath,'w'))
+ json.dump(
+ self.obj_Appconfig.project_explorer, open(
+ self.obj_Appconfig.dictPath, 'w'))
self.obj_Appconfig.print_info('Open Project called')
self.obj_Appconfig.print_info('Current Project is ' + self.projDir)
return dirs, filelist
-
+
else:
- self.obj_Appconfig.print_error("The project doesn't contain .proj file. Please select the proper directory else you won't be able to perform any operation")
- reply = QtGui.QMessageBox.critical(None, "Error Message",''' Error: The project doesn't contain .proj file.
- Please select the proper project directory else you won't be able to perform any operation''',QtGui.QMessageBox.Ok|QtGui.QMessageBox.Cancel)
-
+ self.obj_Appconfig.print_error(
+ "The project doesn't contain .proj file. Please select the proper directory else you won't be able to perform any operation")
+ reply = QtGui.QMessageBox.critical(None, "Error Message", ''' Error: The project doesn't contain .proj file.
+ Please select the proper project directory else you won't be able to perform any operation''', QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
+
if reply == QtGui.QMessageBox.Ok:
self.body()
self.obj_Appconfig.print_info('Open Project called')
- self.obj_Appconfig.print_info('Current Project is ' + self.projDir)
+ self.obj_Appconfig.print_info(
+ 'Current Project is ' + self.projDir)
elif reply == QtGui.QMessageBox.Cancel:
self.obj_Appconfig.print_info('No Project opened')
else:
pass
-
-
-
-
-
-
\ No newline at end of file
--
cgit
From 818c3f2d43914940ba3cdf580c5a6f26a8200834 Mon Sep 17 00:00:00 2001
From: nilshah98
Date: Tue, 28 May 2019 00:27:24 +0530
Subject: projectManagement, ngspicetoModelica, subcircuit made pep8 compliant
---
src/projManagement/openProject.py | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
(limited to 'src/projManagement/openProject.py')
diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py
index 58a6be0a..6cdcbb38 100644
--- a/src/projManagement/openProject.py
+++ b/src/projManagement/openProject.py
@@ -1,5 +1,5 @@
-#=========================================================================
+# =========================================================================
#
# FILE: openProject.py
#
@@ -15,7 +15,7 @@
# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
# CREATED: Wednesday 12 February 2015
# REVISION: ---
-#=========================================================================
+# =========================================================================
from PyQt4 import QtGui
from .Validation import Validation
@@ -39,7 +39,7 @@ class OpenProjectInfo(QtGui.QWidget):
self.projDir = QtGui.QFileDialog.getExistingDirectory(
self, "open", self.openDir)
- if self.obj_validation.validateOpenproj(self.projDir) == True:
+ if self.obj_validation.validateOpenproj(self.projDir):
self.obj_Appconfig.current_project['ProjectName'] = str(
self.projDir)
if os.path.isdir(self.projDir):
@@ -47,8 +47,10 @@ class OpenProjectInfo(QtGui.QWidget):
for dirs, subdirs, filelist in os.walk(
self.obj_Appconfig.current_project["ProjectName"]):
- directory = dirs
- files = filelist
+ # directory = dirs
+ # files = filelist
+ # above 'directory' and 'files' variable never used
+ pass
self.obj_Appconfig.project_explorer[dirs] = filelist
json.dump(
self.obj_Appconfig.project_explorer, open(
@@ -59,9 +61,15 @@ class OpenProjectInfo(QtGui.QWidget):
else:
self.obj_Appconfig.print_error(
- "The project doesn't contain .proj file. Please select the proper directory else you won't be able to perform any operation")
- reply = QtGui.QMessageBox.critical(None, "Error Message", ''' Error: The project doesn't contain .proj file.
- Please select the proper project directory else you won't be able to perform any operation''', QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
+ "The project doesn't contain .proj file. Please select the"
+ + "proper directory else you won't be able to perform any"
+ + "operation")
+ reply = QtGui.QMessageBox.critical(None, "Error Message",
+ '''Error: The project doesn't contain .proj file.
+ Please select the proper project directory else you won't
+ be able to perform any operation''',
+ QtGui.QMessageBox.Ok |
+ QtGui.QMessageBox.Cancel)
if reply == QtGui.QMessageBox.Ok:
self.body()
--
cgit