Jeong Geol Kim 4 лет назад
Родитель
Сommit
fbd2d19ccb
3 измененных файлов: 25 добавлений и 2 удалений
  1. Двоичные данные
      how_to_use/MAIL시스템실행프로세스.pdf
  2. 21
    1
      main.py
  3. 4
    1
      settings.json

Двоичные данные
how_to_use/MAIL시스템실행프로세스.pdf Просмотреть файл


+ 21
- 1
main.py Просмотреть файл

@@ -10,17 +10,30 @@ settings =[]
10 10
 customer_code = ''
11 11
 surgery_date =  str(time.strftime('%Y%m%d', time.localtime(time.time())))
12 12
 
13
+
13 14
 with open('./settings.json', encoding='utf-8')as json_file:
14 15
     json_data = json.load(json_file)
15 16
     settings.append(json_data['window_name'])
16 17
     settings.append(json_data['window_position'])
17 18
     settings.append(json_data['branch_location'])
18 19
     settings.append(json_data['surgery_room_number'])
20
+    settings.append(json_data['ddns'])
21
+    settings.append(json_data['account']) #settings[5]
22
+    settings.append(json_data['password']) #settings[6]
19 23
 
20 24
 window.title(settings[0])
21 25
 window.geometry(settings[1])
22 26
 window.resizable(False,False)
23 27
 
28
+def sshConnect():
29
+    ssh = paramiko.SSHClient()
30
+    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
31
+    ssh.connect(settings[4],port= settings[3], username=settings[5], password=settings[6])
32
+
33
+    stdin, stdout, stderr = ssh.exec_command('echo this is paramiko')
34
+    # TODO: 여기에 스크립트 명령어 입력
35
+    print(stdout.readlines())
36
+
24 37
 label_branch = tkinter.Label(window, text = '지점 위치: ' + settings[2] + ' / 수술방 번호: ' + str(settings[3]))
25 38
 label_customer_code = tkinter.Label(window, text="고객번호(지점 번호 포함 9자리)")
26 39
 
@@ -55,6 +68,7 @@ def askQuit():
55 68
     msg_box = messagebox.askquestion("기록 중지 확인", '기록을 중지하시겠습니까?')
56 69
     if msg_box == 'yes':
57 70
         #TODO: docker 중지 명령어 보내기
71
+        sshConnect()
58 72
         window.destroy()
59 73
 
60 74
 
@@ -67,6 +81,9 @@ def buttonAction(event):
67 81
         askQuit()
68 82
 # def fillSurgeryDate():
69 83
 
84
+
85
+
86
+
70 87
 entry_customer_code = tkinter.Entry(window)
71 88
 entry_surgery_date = tkinter.Entry(window)
72 89
 button_confirm = tkinter.Button(window, text="입력완료", width=20, height=2)
@@ -80,4 +97,7 @@ entry_customer_code.pack()
80 97
 
81 98
 button_confirm.pack()
82 99
 
83
-window.mainloop()
100
+window.mainloop()
101
+
102
+
103
+

+ 4
- 1
settings.json Просмотреть файл

@@ -2,5 +2,8 @@
2 2
     "window_name":"365mc M.A.I.L system Recorder",
3 3
     "window_position": "240x240+300+300",
4 4
     "branch_location": "서울",
5
-    "surgery_room_number": 801
5
+    "surgery_room_number": 801,
6
+    "ddns": "mailsys36.iptime.org",
7
+    "account": "mc365",
8
+    "password": "tkadbrdhmc1!"
6 9
 }

Загрузка…
Отмена
Сохранить