config file
This commit is contained in:
parent
63f7b0cac4
commit
34ffc59c23
7
client/view/dncClient.conf
Normal file
7
client/view/dncClient.conf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[NETWORK]
|
||||||
|
port = 2222
|
||||||
|
ip = 127.0.0.1
|
||||||
|
|
||||||
|
[PSEUDO]
|
||||||
|
name = bob
|
||||||
|
|
@ -5,8 +5,8 @@ from PySide.QtGui import *
|
|||||||
import time, threading, datetime, time, random,re
|
import time, threading, datetime, time, random,re
|
||||||
from socket import *
|
from socket import *
|
||||||
from pmWindow import Ui_Dialog2
|
from pmWindow import Ui_Dialog2
|
||||||
Host = "127.0.0.1"
|
import configparser
|
||||||
Port = 2222
|
|
||||||
|
|
||||||
|
|
||||||
class MySignal(QObject):
|
class MySignal(QObject):
|
||||||
@ -476,7 +476,28 @@ class start(QtGui.QDialog):
|
|||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
|
|
||||||
ano = "anonymous" + ''.join(str(random.randint(1,9)) for _ in range(2))
|
ano = "anonymous" + ''.join(str(random.randint(1,9)) for _ in range(2))
|
||||||
self.ui.lineEdit_2.setText(ano)
|
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
|
||||||
|
config.read("dncClient.conf")
|
||||||
|
|
||||||
|
port = config.get("NETWORK", "port")
|
||||||
|
ip = config.get("NETWORK", "ip")
|
||||||
|
name = config.get("PSEUDO", "name")
|
||||||
|
|
||||||
|
if name is not None :
|
||||||
|
self.ui.lineEdit_2.setText(name)
|
||||||
|
else :
|
||||||
|
self.ui.lineEdit_2.setText(ano)
|
||||||
|
|
||||||
|
if ip is not None :
|
||||||
|
self.ui.lineEdit_4.setText(ip)
|
||||||
|
|
||||||
|
|
||||||
|
if port is not None :
|
||||||
|
self.ui.lineEdit_3.setText(port)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.ui.lineEdit.setDisabled(True)
|
self.ui.lineEdit.setDisabled(True)
|
||||||
self.ui.pushButton.setDisabled(True)
|
self.ui.pushButton.setDisabled(True)
|
||||||
|
Reference in New Issue
Block a user