Skip to content

Commit

Permalink
minor improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrj committed Jan 26, 2024
1 parent 2ffdee3 commit d011184
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The primary purpose of this software is to enable users to catalog their files,
![image info](./info/menu.png)

## [Download](https://github.com/PJDude/librer/releases) ##
Portable executable packages created with [PyInstaller](https://pyinstaller.org/en/stable) for **Linux** and **Windows** can be downloaded from the Releases site.
Portable executable packages created with [PyInstaller](https://pyinstaller.org/en/stable) for **Linux** and **Windows** can be downloaded from the Releases site. Simultaneously, on **nuitka** branch, builds are made with [nuitka](https://github.com/Nuitka/Nuitka) compiler with its all pros and cons. These builds are marked as Pre-release and have separate build counter.

## [MAJORGEEKS review](https://www.majorgeeks.com/files/details/librer.html) ##

Expand Down
9 changes: 5 additions & 4 deletions src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1709,20 +1709,20 @@ def import_records_wii_do(self,compr,postfix,label,quant_files,quant_folders,fil

new_record = self.create()

expressions='WII_import'
expressions=''
use_smin=False
smin_int=0
use_smax=False
smax_int=0
executable='WII_import'
executable=''
parameters=''
shell=False
timeout=0
crc=False

new_record.header.cde_list = [ [expressions,use_smin,smin_int,use_smax,smax_int,executable,parameters,shell,timeout,crc] ]

new_record.header.scan_path = 'WII_import'
new_record.header.scan_path = ' -- Imported from "Where Is It? -- '

new_record.customdata = [(0,0,cd_elem) for cd_elem in cd_set]

Expand All @@ -1735,7 +1735,7 @@ def import_records_wii_do(self,compr,postfix,label,quant_files,quant_folders,fil

new_record.filenames = tuple(sorted(list(filenames_set)))
new_record.header.label = label
new_record.header.scan_path = 'WII import'

new_record.filenames_helper = {fsname:fsname_index for fsname_index,fsname in enumerate(new_record.filenames)}

new_record.header.quant_files = quant_files
Expand Down Expand Up @@ -1767,6 +1767,7 @@ def import_records_wii_do(self,compr,postfix,label,quant_files,quant_folders,fil
new_record.header.quant_folders = sub_folders_quant

new_record.header.items_names=len(new_record.filenames)
new_record.header.items_cd=len(new_record.customdata)

new_record.filestructure = ('',code,sub_size,mtime,new_record.tupelize_rec(scan_like_data,print))

Expand Down
20 changes: 12 additions & 8 deletions src/librer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ def get_wii_import_dialog(self):

self.wii_import_compr_var.set(9)
self.wii_import_compr_var_int.set(9)
self.wii_import_label_var.set('WII-imported')


self.wii_import_brief_label=Label(self.wii_import_dialog.area_main,text='',bd=2,bg=self.bg_color,takefocus=False,relief='groove',anchor='w',justify='left')
self.wii_import_brief_label.grid(row=0,column=0,sticky='news',padx=4,pady=4,columnspan=2)
Expand Down Expand Up @@ -1880,9 +1880,11 @@ def record_import_wii(self):
###########################
dialog = self.get_wii_import_dialog()

#self.wii_import_label_var.set(self.current_record.header.label)
self.wii_import_compr_var.set(9)
self.wii_import_compr_var_int.set(9)
if len(import_filenames)>1:
self.wii_import_label_var.set(f'WII-imported-multiple-files')
else:
self.wii_import_label_var.set(f'WII-imported-{Path(import_filenames[0]).stem}')

self.wii_import_brief_label.configure(text=f'GATHERED DATA:\ndisks : {fnumber(quant_disks)}\nfiles : {fnumber(quant_files)}\nfolders : {fnumber(quant_folders)}')

dialog.show()
Expand Down Expand Up @@ -4005,7 +4007,7 @@ def single_record_show(self,record):
sum_size+=record_temp.header.sum_size
quant_files+=record_temp.header.quant_files

self.widget_tooltip(self.status_records_all,f'All records in repository : {records_len}\nSum data size : {bytes_to_str(sum_size)}\nSum files quantity : {fnumber(quant_files)}\n\nClick to unload (free memory) data of selected record\nDouble click to unload data of all records.')
self.widget_tooltip(self.status_records_all,f'Records in repository : {records_len}\nSum data size : {bytes_to_str(sum_size)}\nSum files quantity : {fnumber(quant_files)}\n\nClick to unload (free memory) data of selected record\nDouble click to unload data of all records.')

self.main_update()

Expand Down Expand Up @@ -4055,6 +4057,7 @@ def show_customdata(self):
if self.actions_processing:
item=self.tree.focus()
if item:
error_infos=[]
try:
if self.tree.tag_has(self.RECORD,item) or self.tree.tag_has(self.RECORD_RAW,item):
self.record_info()
Expand All @@ -4070,11 +4073,12 @@ def show_customdata(self):

if has_cd: #wiec nie has_files
cd_index = data_tuple[4]
error_infos.append(f'{cd_index=},type:{type(cd_index)}')

self.access_customdata(record)

cd_field = record.customdata[cd_index]

error_infos.append(' '.join(str(cd_field)))
if cd_data := cd_field[2]:
rule_nr=cd_field[0]
returncode=cd_field[1]
Expand All @@ -4083,7 +4087,7 @@ def show_customdata(self):

file_path = normpath(sep.join([record.header.scan_path,sep.join(subpath_list)]))

cd_txt = cd_data
cd_txt = str(cd_data)

command,command_info = get_command(executable,parameters,file_path,shell)

Expand All @@ -4095,7 +4099,7 @@ def show_customdata(self):
self.info_dialog_on_main.show('Information','No Custom data.')

except Exception as e:
self.info_dialog_on_main.show('Custom Data Info Error',str(e))
self.info_dialog_on_main.show('Custom Data Info Error',str(e) + ('\n' + '\n'.join(error_infos)) if error_infos else '')

def record_info(self):
if self.actions_processing:
Expand Down

0 comments on commit d011184

Please sign in to comment.