Skip to content

Commit 7d5448f

Browse files
author
piotrj
committedMar 2, 2024·
Merge remote-tracking branch 'origin/devel'
# Conflicts: # .github/workflows/run.yml
2 parents 95bc4c6 + 0c675d5 commit 7d5448f

File tree

11 files changed

+795
-339
lines changed

11 files changed

+795
-339
lines changed
 

‎.github/workflows/run.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ jobs:
238238
path: ./
239239

240240
- name: rename windows distro
241-
run: mv ./librer.win.zip ./librer.${{ steps.version.outputs.version }}.nuitka.portable.windows.zip
241+
run: mv ./librer.win.zip ./librer.${{ steps.version.outputs.version }}.portable.windows.nuitka.zip
242+
242243

243244
#####################################
244245
- name: download linux nuitka distro
@@ -248,7 +249,7 @@ jobs:
248249
path: ./
249250

250251
- name: rename linux distro
251-
run: mv ./librer.lin.zip ./librer.${{ steps.version.outputs.version }}.nuitka.portable.linux.zip
252+
run: mv ./librer.lin.zip ./librer.${{ steps.version.outputs.version }}.portable.linux.nuitka.zip
252253

253254
#####################################
254255
- name: Create GitHub release
@@ -262,7 +263,8 @@ jobs:
262263
prerelease: false
263264
files: |
264265
librer.${{ steps.version.outputs.version }}.portable.linux.zip
266+
librer.${{ steps.version.outputs.version }}.portable.linux.nuitka.zip
265267
librer.${{ steps.version.outputs.version }}.portable.windows.zip
266-
librer.${{ steps.version.outputs.version }}.nuitka.portable.linux.zip
267-
librer.${{ steps.version.outputs.version }}.nuitka.portable.windows.zip
268+
librer.${{ steps.version.outputs.version }}.portable.windows.nuitka.zip
269+
268270

‎requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ psutil==5.9.8
55
pympler==1.0.1
66
ciso8601==2.3.1
77
pywin32==306; sys.platform == 'win32'
8-
nuitka==2.0.2
8+
nuitka==2.0.6

‎src/core.py

+331-182
Large diffs are not rendered by default.

‎src/dialogs.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,10 @@ def __init__(self,parent,icon,bg_color,pre_show=None,post_close=None,min_width=1
356356
self.area_main.grid_columnconfigure(0, weight=1)
357357

358358
self.cancel_button=Button(self.area_buttons, text='Close', width=14, command=super().hide )
359-
self.cancel_button.pack(side='right', anchor='e',padx=2,pady=5)
359+
self.cancel_button.pack(side='right', anchor='e',padx=2,pady=5,fill='both')
360360

361361
self.copy_button=Button(self.area_buttons, text='Copy', width=14, command=self.clip_copy_message )
362-
self.copy_button.pack(side='right', anchor='w',padx=2,pady=5)
362+
self.copy_button.pack(side='right', anchor='w',padx=2,pady=5,fill='both')
363363

364364
self.find_next_butt=Button(self.area_mark, command=lambda : self.find_next_prev(1), width=1)
365365
self.find_next_butt.pack(side='right', anchor='w',padx=2,pady=5,fill='both')
@@ -372,6 +372,10 @@ def __init__(self,parent,icon,bg_color,pre_show=None,post_close=None,min_width=1
372372
self.find_prev_butt=Button(self.area_mark, command=lambda : self.find_next_prev(-1), width=1)
373373
self.find_prev_butt.pack(side='right', anchor='w',padx=2,pady=5,fill='both')
374374

375+
self.find_cs_var=BooleanVar()
376+
self.find_cs=Checkbutton(self.area_mark,text='C.S.',variable=self.find_cs_var, command=lambda : self.find_key_binding() )
377+
self.find_cs.pack(side='right', anchor='e',padx=5,pady=5,expand='yes', fill='both')
378+
375379
self.find_var=StringVar()
376380
self.find_entry=Entry(self.area_mark, textvariable=self.find_var, width=22)
377381
self.find_entry.pack(side='right', anchor='w',padx=2,pady=5,fill='both')
@@ -384,7 +388,7 @@ def __init__(self,parent,icon,bg_color,pre_show=None,post_close=None,min_width=1
384388
self.text_search_pool_index=0
385389

386390
self.find_lab=Label(self.area_mark)
387-
self.find_lab.pack(side='right', anchor='e',padx=5,pady=5)
391+
self.find_lab.pack(side='right', anchor='e',padx=5,pady=5,expand='yes', fill='both')
388392

389393
try:
390394
self.find_lab.configure(text='Mark:',compound='left')
@@ -459,7 +463,7 @@ def find_key_binding(self,event=None):
459463
len_search_str = len(search_str)
460464

461465
while True:
462-
start_index = self_text_search(search_str, start_index, 'end')
466+
start_index = self_text_search(search_str, start_index, 'end',nocase=0 if self.find_cs_var.get() else 1)
463467
if not start_index:
464468
break
465469
end_index = f"{start_index}+{len_search_str}c"
@@ -505,7 +509,7 @@ def __init__(self,parent,icon,bg_color,pre_show=None,post_close=None,min_width=8
505509
self.cancel_button.pack(side='left', anchor='n',padx=5,pady=5)
506510

507511
self.ok_button=Button(self.area_buttons, text='OK', width=14, command=self.ok,image=image, compound='left' )
508-
self.ok_button.pack(side='right', anchor='n',padx=5,pady=5)
512+
self.ok_button.pack(side='right', anchor='n',padx=5,pady=5,fill='both')
509513

510514
self.focus=self.cancel_button
511515

‎src/icons/cd_aborted.png

105 Bytes
Loading

‎src/icons/cd_empty.png

114 Bytes
Loading

‎src/icons/left.png

-143 Bytes
Loading

‎src/icons/right.png

-129 Bytes
Loading

‎src/icons/up.png

-45 Bytes
Loading

‎src/librer.py

+425-126
Large diffs are not rendered by default.

‎src/record.py

+23-21
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,21 @@ def caretaker(signal_file):
126126
sys_stdout_flush = sys.stdout.flush
127127
lines_non_stop=0
128128

129+
json_dumps_loc = json_dumps
130+
stdout_data_queue_loc = stdout_data_queue
131+
path_exists_loc = path_exists
132+
129133
def flush_last_data_not_printed(flush):
130134
nonlocal last_data_not_printed
131135
if last_data_not_printed:
132-
print(json_dumps(last_data_not_printed),flush=flush)
136+
print(json_dumps_loc(last_data_not_printed),flush=flush)
133137
last_data_not_printed=None
134138

135139
while True:
136140
now=perf_counter()
137141
now_grater_than_next_time_print = bool(now>next_time_print)
138142

139-
if stdout_data_queue:
143+
if stdout_data_queue_loc:
140144
data,always=stdout_data_queue_get()
141145

142146
if data==True:
@@ -146,7 +150,7 @@ def flush_last_data_not_printed(flush):
146150
flush_last_data_not_printed(False)
147151

148152
if always or now_grater_than_next_time_print:
149-
print(json_dumps(data),flush=True)
153+
print(json_dumps_loc(data),flush=True)
150154
next_time_print=now+print_min_time_period
151155
lines_non_stop+=1
152156
last_data_not_printed=None
@@ -163,7 +167,7 @@ def flush_last_data_not_printed(flush):
163167

164168
if now>next_signal_file_check:
165169
next_signal_file_check=now+signal_file_check_period
166-
if path_exists(signal_file):
170+
if path_exists_loc(signal_file):
167171
try:
168172
with open(signal_file,'r') as sf:
169173
got_int = int(sf.read().strip())
@@ -174,7 +178,7 @@ def flush_last_data_not_printed(flush):
174178
except Exception as pe:
175179
print_info(f'check_abort error:{pe}')
176180

177-
sleep(0.01)
181+
sleep(0.001)
178182

179183
sys.exit(0) #thread
180184

@@ -265,20 +269,20 @@ def proper_exit(code):
265269
cd_glob=bool(find_cd_search_kind=='glob')
266270
cd_fuzzy=bool(find_cd_search_kind=='fuzzy')
267271
cd_error=bool(find_cd_search_kind=='error')
272+
cd_empty=bool(find_cd_search_kind=='empty')
273+
cd_aborted=bool(find_cd_search_kind=='aborted')
268274
cd_without=bool(find_cd_search_kind=='without')
269275
cd_ok=bool(find_cd_search_kind=='any')
270276

271277
if cd_regexp:
272278
custom_data_needed=True
273-
cd_search_kind='regexp'
274279
if res := test_regexp(cd_expr):
275280
proper_exit(res)
276281
re_obj_cd=re_compile(cd_expr, MULTILINE | DOTALL)
277282
cd_func_to_call = lambda x : re_obj_cd.match(x)
278283

279284
elif cd_glob:
280285
custom_data_needed=True
281-
cd_search_kind='glob'
282286
if cd_case_sens:
283287
re_obj_cd=re_compile(translate(cd_expr), MULTILINE | DOTALL)
284288
cd_func_to_call = lambda x : re_obj_cd.match(x)
@@ -287,19 +291,17 @@ def proper_exit(code):
287291
cd_func_to_call = lambda x : re_obj_cd.match(x)
288292
elif cd_fuzzy:
289293
custom_data_needed=True
290-
cd_search_kind='fuzzy'
291294
cd_func_to_call = lambda x : bool(SequenceMatcher(None,cd_expr, x).ratio()>cd_fuzzy_threshold)
292295
elif cd_without:
293-
cd_search_kind='without'
296+
cd_func_to_call = None
297+
elif cd_empty:
294298
cd_func_to_call = None
295299
elif cd_error:
296-
cd_search_kind='error'
297300
cd_func_to_call = None
298301
elif cd_ok:
299-
cd_search_kind='any'
300302
cd_func_to_call = None
301303
else:
302-
cd_search_kind='dont'
304+
#cd_search_kind='dont'
303305
cd_func_to_call = None
304306

305307
#####################################################################
@@ -319,7 +321,7 @@ def proper_exit(code):
319321
size_min,size_max,
320322
t_min,t_max,
321323
name_search_kind,name_func_to_call,
322-
cd_search_kind,cd_func_to_call,
324+
find_cd_search_kind,cd_func_to_call,
323325
print_info)
324326
except Exception as fe:
325327
print_info(f'find_items error:{fe}')
@@ -334,32 +336,32 @@ def proper_exit(code):
334336
with open(sep.join([comm_dir,SCAN_DAT_FILE]),"rb") as f:
335337
create_list = loads(ZstdDecompressor().decompress(f.read()))
336338

337-
label,path_to_scan,check_dev,cde_list = create_list
339+
label,path_to_scan,check_dev,compression_level,threads,cde_list = create_list
338340
except Exception as e:
339341
print_info(f'create error:{e}')
340342
proper_exit(2)
341343
else:
342344
new_record = LibrerRecord(label=label,scan_path=path_to_scan)
343345

344346
try:
345-
print_func(['stage',0],True)
347+
print_func(('stage',0),True)
346348
new_record.scan(print_func,abort_list,tuple(cde_list),check_dev)
347349
except Exception as fe:
348350
print_info(f'scan error:{fe}')
349351
else:
350352
if not abort_list[0]:
351353
if cde_list :
352354
try:
353-
print_func(['stage',1],True)
354-
new_record.extract_customdata(print_func,abort_list)
355+
print_func(('stage',1),True)
356+
new_record.extract_customdata(print_func,abort_list,threads=threads)
355357
except Exception as cde:
356358
print_info(f'cde error:{cde}')
357359

358-
print_func(['stage',2],True)
360+
print_func(('stage',2),True)
359361
new_record.pack_data(print_func)
360-
print_func(['stage',3],True)
361-
new_record.save(print_func,file_path=args.file,compression_level=9)
362-
print_func(['stage',4],True)
362+
print_func(('stage',3),True)
363+
new_record.save(print_func,file_path=args.file,compression_level=compression_level)
364+
print_func(('stage',4),True)
363365

364366
#####################################################################
365367
else:

0 commit comments

Comments
 (0)
Please sign in to comment.