MCPcopy
hub / github.com/tonquer/JMComic-qt / GetNasInfo

Method GetNasInfo

src/view/nas/nas_add_view.py:113–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

111 return
112
113 def GetNasInfo(self):
114 nasInfo = NasInfoItem()
115 nasInfo.nasId = self.nextId
116 address = self.addressEdit.text()
117 title = self.titleEdit.text()
118 path = self.pathEdit.text()
119 user = self.userEdit.text()
120 password = self.passEdit.text()
121 isWaifu2x = self.isWaifu2x.isChecked()
122 index = self.buttonGroup.checkedId()
123 compressId = self.compressGroup.checkedId()
124 type = int(self.comboBox.currentIndex())
125 if type != 2:
126 if not address or not title or not path or not user or not password :
127 return None
128 else:
129 if not title or not path:
130 return None
131 nasInfo.address = address
132 nasInfo.title = title
133 nasInfo.passwd = password
134 nasInfo.user = user
135 nasInfo.path = path
136 nasInfo.is_waifu2x = isWaifu2x
137 nasInfo.dir_index = index
138 nasInfo.compress_index = compressId
139 nasInfo.type = int(self.comboBox.currentIndex())
140 if self.portEdit.text():
141 nasInfo.port = int(self.portEdit.text())
142 return nasInfo
143
144 def Save(self):
145 nasInfo = self.GetNasInfo()

Callers 2

SaveMethod · 0.95
TestLinkMethod · 0.95

Calls 2

NasInfoItemClass · 0.90
textMethod · 0.80

Tested by

no test coverage detected