File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import datetime
12import hashlib
23import json
34import 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):
7678print ('================================================' )
7779
7880set_config (conf )
79- set_language (conf ['language' ])
8081last_hash = ''
8182
8283try :
@@ -91,8 +92,8 @@ def set_config(conf):
9192while 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
You can’t perform that action at this time.
0 commit comments