diff options
author | maddy-2 | 2019-05-27 12:55:18 +0530 |
---|---|---|
committer | nilshah98 | 2019-06-07 11:03:16 +0530 |
commit | 90d656da8cc6dfb076fa2b8ec9764e9bf391bda7 (patch) | |
tree | 22ce01b5ca69ae407f99b63439dad27600d40520 /src/kicadtoNgspice/Model.py | |
parent | 32132ebfcc90e993acc3a87c4017ef0b00bcd890 (diff) | |
download | eSim-90d656da8cc6dfb076fa2b8ec9764e9bf391bda7.tar.gz eSim-90d656da8cc6dfb076fa2b8ec9764e9bf391bda7.tar.bz2 eSim-90d656da8cc6dfb076fa2b8ec9764e9bf391bda7.zip |
kicadtoNgspice made pep8 compliant
Diffstat (limited to 'src/kicadtoNgspice/Model.py')
-rw-r--r-- | src/kicadtoNgspice/Model.py | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/src/kicadtoNgspice/Model.py b/src/kicadtoNgspice/Model.py index 7366a593..7ae41791 100644 --- a/src/kicadtoNgspice/Model.py +++ b/src/kicadtoNgspice/Model.py @@ -1,7 +1,7 @@ from PyQt4 import QtGui import json from . import TrackWidget -#from xml.etree import ElementTree as ET +# from xml.etree import ElementTree as ET import os @@ -48,7 +48,7 @@ class Model(QtGui.QWidget): self.setLayout(self.grid) for line in modelList: - #print "ModelList Item:",line + # print "ModelList Item:",line # Adding title label for model # Key: Tag name,Value:Entry widget number tag_dict = {} @@ -59,8 +59,8 @@ class Model(QtGui.QWidget): # line[7] is parameter dictionary holding parameter tags. i = 0 for key, value in line[7].items(): - #print "Key : ",key - #print "Value : ",value + # print "Key : ",key + # print "Value : ",value # Check if value is iterable if hasattr(value, '__iter__'): # For tag having vector value @@ -68,16 +68,22 @@ class Model(QtGui.QWidget): for item in value: paramLabel = QtGui.QLabel(item) modelgrid.addWidget(paramLabel, self.nextrow, 0) - self.obj_trac.model_entry_var[self.nextcount] = QtGui.QLineEdit( + self.obj_trac.model_entry_var + [self.nextcount] = QtGui.QLineEdit( ) modelgrid.addWidget( - self.obj_trac.model_entry_var[self.nextcount], self.nextrow, 1) + self.obj_trac.model_entry_var + [self.nextcount], self.nextrow, 1) try: for mod in json_data["model"]: - if json_data["model"][mod]["type"] == line[2] and mod == line[3]: - self.obj_trac.model_entry_var[self.nextcount].setText( - str(list(json_data["model"][mod]["values"][i].values())[0])) + if json_data["model"][mod]["type"] ==\ + line[2] and mod == line[3]: + self.obj_trac.model_entry_var + [self.nextcount].setText( + str(list( + json_data["model"][mod]["values"] + [i].values())[0])) i = i + 1 except BaseException: pass @@ -90,16 +96,22 @@ class Model(QtGui.QWidget): else: paramLabel = QtGui.QLabel(value) modelgrid.addWidget(paramLabel, self.nextrow, 0) - self.obj_trac.model_entry_var[self.nextcount] = QtGui.QLineEdit( + self.obj_trac.model_entry_var + [self.nextcount] = QtGui.QLineEdit( ) modelgrid.addWidget( - self.obj_trac.model_entry_var[self.nextcount], self.nextrow, 1) + self.obj_trac.model_entry_var + [self.nextcount], self.nextrow, 1) try: for mod in json_data["model"]: - if json_data["model"][mod]["type"] == line[2] and mod == line[3]: - self.obj_trac.model_entry_var[self.nextcount].setText( - str(list(json_data["model"][mod]["values"][i].values())[0])) + if json_data["model"][mod]["type"] ==\ + line[2] and mod == line[3]: + self.obj_trac.model_entry_var + [self.nextcount].setText( + str(list(json_data + ["model"][mod]["values"] + [i].values())[0])) i = i + 1 except BaseException: pass @@ -109,13 +121,15 @@ class Model(QtGui.QWidget): self.nextrow = self.nextrow + 1 self.end = self.nextcount - 1 - #print "End",self.end + # print "End",self.end modelbox.setLayout(modelgrid) # CSS modelbox.setStyleSheet(" \ - QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \ - QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \ + QGroupBox { border: 1px solid gray; border-radius: \ + 9px; margin-top: 0.5em; } \ + QGroupBox::title { subcontrol-origin: margin; left:\ + 10px; padding: 0 3px 0 3px; } \ ") self.grid.addWidget(modelbox) @@ -129,7 +143,8 @@ class Model(QtGui.QWidget): line[4] = comment line[5] = title line[6] = type i.e analog or digital - Now adding start,end and tag_dict which will be line[7],line[8] and line[9] respectively + Now adding start,end and tag_dict which will be line[7], + line[8] and line[9] respectively ''' # This keeps the track of Model Tab Widget @@ -152,6 +167,6 @@ class Model(QtGui.QWidget): if check == 0: self.obj_trac.modelTrack.append(lst) - #print "The tag dictionary : ",tag_dict + # print "The tag dictionary : ",tag_dict self.show() |