Skip to content

Commit 71221da

Browse files
committed
v2.0.0
1 parent 58c267f commit 71221da

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

client/copa.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
import hashlib
23
import json
34
import os
@@ -49,6 +50,7 @@ def get_config():
4950
conf.update(custom_conf)
5051
except:
5152
pass
53+
set_language(conf['language'])
5254
conf['interval'] = int(conf['interval'])
5355
if not conf['token']:
5456
print(_('Please set a token when your first time.'))
@@ -76,7 +78,6 @@ def set_config(conf):
7678
print('================================================')
7779

7880
set_config(conf)
79-
set_language(conf['language'])
8081
last_hash = ''
8182

8283
try:
@@ -91,8 +92,8 @@ def set_config(conf):
9192
while True:
9293

9394
try:
94-
95-
time.sleep(conf['interval'])
95+
print('==========', datetime.datetime.now(), '==========')
96+
9697
uri = f'/mirror/clipboards/{conf["token"]}/'
9798

9899
curr_clip = pyperclip.paste()
@@ -118,13 +119,14 @@ def set_config(conf):
118119
pyperclip.copy(content)
119120
last_hash = remote_hash
120121
print(_('get newest clipboard from remote'))
121-
122-
print('======================================')
123-
122+
124123
except:
125124
print('================== error ==================')
126125
traceback.print_exc()
127126
# input(_('Press enter to exit'))
127+
128+
finally:
129+
time.sleep(conf['interval'])
128130

129131

130132

0 commit comments

Comments
 (0)