pyflutter-app 0.3.11__tar.gz → 0.3.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/PKG-INFO +1 -1
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/cartas/__init__.py +34 -9
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/config_app.py +63 -9
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/controller_forms.py +15 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/view_forms.py +13 -8
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_image/__init__.py +2 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_image/common.py +4 -1
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_image/controller_image.py +172 -50
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_image/model_image.py +18 -14
- pyflutter_app-0.3.13/converter/page_image/progress.py +77 -0
- pyflutter_app-0.3.13/converter/page_image/renderer.py +240 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_image/view_image.py +31 -39
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_image/widgets.py +135 -18
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_ocr/controller_ocr.py +14 -3
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_ocr/view_ocr.py +10 -9
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_whatsapp/controller_whatsapp.py +21 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_whatsapp/model_whatsapp.py +47 -5
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_whatsapp/view_whatsapp.py +18 -9
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/table_widget.py +62 -60
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/ui/buttons.py +18 -16
- pyflutter_app-0.3.13/pyflutter_ui/ui/progress.py +115 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyproject.toml +1 -1
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/table_stream/__init__.py +1 -1
- pyflutter_app-0.3.13/teste.py +27 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/uv.lock +5 -5
- pyflutter_app-0.3.11/cartas/origin.py +0 -1196
- pyflutter_app-0.3.11/converter/page_image/renderer.py +0 -92
- pyflutter_app-0.3.11/pyflutter_ui/ui/progress.py +0 -80
- pyflutter_app-0.3.11/teste.py +0 -9
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.gitignore +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.idea/.gitignore +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.idea/inspectionProfiles/Project_Default.xml +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.idea/misc.xml +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.idea/modules.xml +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.idea/pyflutter_app.iml +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/.idea/vcs.xml +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/README.md +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/convert_stream/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/__main__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/assets/forms_config.json +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/home_page/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/home_page/_page_edit.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/home_page/controller.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/home_page/model.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/home_page/page_sheets.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/home_page/view.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/lib_toi.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_circuit/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_circuit/common.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_circuit/controller_circuit.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_circuit/model_circuit.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_circuit/service.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_circuit/view_circuit.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/Diagnorstico.txt +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/common.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/config.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/diagnose_forms.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/master_forms.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/model_forms.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_forms/service.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_ocr/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_ocr/common.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_ocr/model_ocr.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_whatsapp/PATCH_whatsapp_files.md +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_whatsapp/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/page_whatsapp/common.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/run_app_convert.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/converter/util.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/local_build/linux.sh +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/local_build/send.sh +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/main.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/mvc/controller.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/mvc/model.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/mvc/view.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/new-export_app.sh +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/ocr_stream/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/app.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/file_picker.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/navigator.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/scheduler.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/theme.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/ui/__init__.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/ui/container.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/ui/core.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/ui/list_builder.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/ui/tables.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/pyflutter_ui/ui/widgets.py +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/update.sh +0 -0
- {pyflutter_app-0.3.11 → pyflutter_app-0.3.13}/whatsapp_files/__init__.py +0 -0
|
@@ -44,7 +44,7 @@ from whatsapp_files import (
|
|
|
44
44
|
move_path,
|
|
45
45
|
)
|
|
46
46
|
|
|
47
|
-
__version__ = "0.
|
|
47
|
+
__version__ = "0.3"
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
@dataclass
|
|
@@ -1762,6 +1762,7 @@ def load_files_toi_v2(
|
|
|
1762
1762
|
print("[DEBUG]: load_files_toi_v2() lista de arquivos vazia!")
|
|
1763
1763
|
return None
|
|
1764
1764
|
|
|
1765
|
+
f: File
|
|
1765
1766
|
for f in files:
|
|
1766
1767
|
if (not f.is_image()) and (not f.is_pdf()):
|
|
1767
1768
|
raise ValueError(
|
|
@@ -1836,7 +1837,7 @@ class RenameFilesTOI:
|
|
|
1836
1837
|
nome de destino (acrescenta -1, -2...). modo_v2=False mantém o fluxo antigo.
|
|
1837
1838
|
"""
|
|
1838
1839
|
|
|
1839
|
-
def __init__(self, files: Set[File], *, modo_v2: bool =
|
|
1840
|
+
def __init__(self, files: Set[File], *, modo_v2: bool = True) -> None:
|
|
1840
1841
|
self.config: ConfigTOI = BuilderConfigTOI().builder()
|
|
1841
1842
|
self.files = files
|
|
1842
1843
|
self.modo_v2: bool = modo_v2
|
|
@@ -1844,10 +1845,10 @@ class RenameFilesTOI:
|
|
|
1844
1845
|
|
|
1845
1846
|
self.base_cartas: Directory = self.config.dir_base_toi
|
|
1846
1847
|
self.error_uc_dir: Directory = self.base_cartas.concat(
|
|
1847
|
-
"
|
|
1848
|
+
"UCS_NAO_IDENTIFICADAS", True
|
|
1848
1849
|
)
|
|
1849
1850
|
self.error_date_dir: Directory = self.base_cartas.concat(
|
|
1850
|
-
"
|
|
1851
|
+
"DATA_NAO_ENCONTRADA", True
|
|
1851
1852
|
)
|
|
1852
1853
|
|
|
1853
1854
|
self.map_files: HashMapDict[hashFile, File] = HashMapDict()
|
|
@@ -1874,6 +1875,27 @@ class RenameFilesTOI:
|
|
|
1874
1875
|
BuilderTableWhatsApp().create_from_data(content_chat.to_dataframe()).rows()
|
|
1875
1876
|
)
|
|
1876
1877
|
|
|
1878
|
+
r: RowWhatsApp
|
|
1879
|
+
for r in rows:
|
|
1880
|
+
h = r.get(HeaderWhatsApp.hash_md5)
|
|
1881
|
+
file_path: File = content_map.get_value(h)
|
|
1882
|
+
|
|
1883
|
+
dt: datetime = r.get_date_hour()
|
|
1884
|
+
y = str(dt.year)
|
|
1885
|
+
m = f"{dt.month:02d}"
|
|
1886
|
+
|
|
1887
|
+
# ano/ano-mes/arquivo
|
|
1888
|
+
current_dir = self.error_uc_dir.concat(y).concat(f"{y}-{m}", True)
|
|
1889
|
+
final_path: File = _resolver_colisao_arquivo(
|
|
1890
|
+
current_dir.join_file(file_path.basename())
|
|
1891
|
+
)
|
|
1892
|
+
|
|
1893
|
+
try:
|
|
1894
|
+
move_path(file_path, final_path)
|
|
1895
|
+
except Exception as e:
|
|
1896
|
+
print(f"{__class__.__name__}(): {e}")
|
|
1897
|
+
|
|
1898
|
+
"""
|
|
1877
1899
|
r: RowWhatsApp
|
|
1878
1900
|
for r in rows:
|
|
1879
1901
|
h = r.get(HeaderWhatsApp.hash_md5)
|
|
@@ -1892,6 +1914,7 @@ class RenameFilesTOI:
|
|
|
1892
1914
|
move_path(file_path, final_path)
|
|
1893
1915
|
except Exception as e:
|
|
1894
1916
|
print(f"{__class__.__name__}(): {e}")
|
|
1917
|
+
"""
|
|
1895
1918
|
|
|
1896
1919
|
def _index_files(self) -> None:
|
|
1897
1920
|
"""Indexa os arquivos originais por hash."""
|
|
@@ -1963,11 +1986,13 @@ class RenameFilesTOI:
|
|
|
1963
1986
|
return self.error_date_dir, f"{uc} {toi}"
|
|
1964
1987
|
|
|
1965
1988
|
year, month, day = date
|
|
1966
|
-
dest_dir = (
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
)
|
|
1989
|
+
# dest_dir = (
|
|
1990
|
+
# self.base_cartas.concat(year)
|
|
1991
|
+
# .concat(f"{year}-{month}")
|
|
1992
|
+
# .concat(f"{year}-{month}-{day}", True)
|
|
1993
|
+
# )
|
|
1994
|
+
|
|
1995
|
+
dest_dir = self.base_cartas.concat(year).concat(f"{year}-{month}", True)
|
|
1971
1996
|
return dest_dir, f"{year} {month} {day} {uc} {toi}"
|
|
1972
1997
|
|
|
1973
1998
|
def _destino_livre(self, dest: File, src: File) -> File:
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Any
|
|
2
3
|
from dataclasses import dataclass
|
|
3
|
-
from table_stream import
|
|
4
|
+
from table_stream import (
|
|
5
|
+
File,
|
|
6
|
+
Directory,
|
|
7
|
+
UserFileSystem,
|
|
8
|
+
JsonConvert,
|
|
9
|
+
HashMapDict,
|
|
10
|
+
HashMap,
|
|
11
|
+
ArrayList,
|
|
12
|
+
)
|
|
4
13
|
from pyflutter_ui.theme import ThemeMode
|
|
5
14
|
from pyflutter_ui.ui.core import ValueNotifier
|
|
6
15
|
|
|
@@ -13,29 +22,42 @@ class MapConfig:
|
|
|
13
22
|
work_dir: Directory
|
|
14
23
|
documents_dir: Directory
|
|
15
24
|
theme_mode: ThemeMode
|
|
25
|
+
initial_dir_map: HashMap[str, Directory]
|
|
16
26
|
|
|
17
27
|
|
|
18
28
|
class FactoryMapConfig(object):
|
|
19
29
|
|
|
20
30
|
def __init__(self) -> None:
|
|
31
|
+
self._conf: MapConfig = self._create()
|
|
32
|
+
|
|
33
|
+
def _create(self) -> MapConfig:
|
|
34
|
+
|
|
21
35
|
self._conf: MapConfig = MapConfig(
|
|
22
36
|
initial_dir=UserFileSystem().get_user_downloads(),
|
|
23
37
|
last_dir=UserFileSystem().get_user_downloads(),
|
|
24
38
|
work_dir=UserFileSystem().get_user_downloads().concat("RFA", True),
|
|
25
39
|
documents_dir=UserFileSystem().get_user_downloads().concat("RFA", True),
|
|
26
40
|
theme_mode=ThemeMode.DARK,
|
|
41
|
+
initial_dir_map=HashMapDict(),
|
|
27
42
|
)
|
|
43
|
+
return self._conf
|
|
44
|
+
|
|
45
|
+
def set_name_initial_dir(self, name: str, d: Directory):
|
|
46
|
+
self._conf.initial_dir_map.set_value(name, d)
|
|
28
47
|
|
|
29
48
|
def create_default(self) -> MapConfig:
|
|
30
49
|
return self._conf
|
|
31
50
|
|
|
32
|
-
def create_from_dict(self, h: HashMapDict[str,
|
|
51
|
+
def create_from_dict(self, h: HashMapDict[str, Any]) -> MapConfig:
|
|
33
52
|
if h.header().contains("initial_dir"):
|
|
34
53
|
self._conf.initial_dir = Directory(h["initial_dir"])
|
|
54
|
+
|
|
35
55
|
if h.header().contains("last_dir"):
|
|
36
56
|
self._conf.last_dir = Directory(h["last_dir"])
|
|
57
|
+
|
|
37
58
|
if h.header().contains("documents_dir"):
|
|
38
59
|
self._conf.last_dir = Directory(h["documents_dir"])
|
|
60
|
+
|
|
39
61
|
if h.header().contains("theme_mode"):
|
|
40
62
|
if h["theme_mode"] == "dark":
|
|
41
63
|
self._conf.theme_mode = ThemeMode.DARK
|
|
@@ -43,6 +65,17 @@ class FactoryMapConfig(object):
|
|
|
43
65
|
self._conf.theme_mode = ThemeMode.LIGHT
|
|
44
66
|
else:
|
|
45
67
|
self._conf.theme_mode = ThemeMode.SYSTEM
|
|
68
|
+
|
|
69
|
+
if h.header().contains("initial_dir_map"):
|
|
70
|
+
_map_initial_dict: dict[str, str] = h.get_value("initial_dir_map")
|
|
71
|
+
final_map = HashMapDict[str, Directory]()
|
|
72
|
+
keys_initial_dir = ArrayList.from_list(list(_map_initial_dict.keys()))
|
|
73
|
+
|
|
74
|
+
keys_initial_dir.for_each(
|
|
75
|
+
lambda k: final_map.set_value(k, Directory(_map_initial_dict[k]))
|
|
76
|
+
)
|
|
77
|
+
self._conf.initial_dir_map = final_map
|
|
78
|
+
|
|
46
79
|
return self._conf
|
|
47
80
|
|
|
48
81
|
def create_from_file(self, file_json: File) -> MapConfig:
|
|
@@ -71,18 +104,39 @@ class AppConfigNotifier(ValueNotifier[MapConfig]):
|
|
|
71
104
|
self._value.documents_dir = d
|
|
72
105
|
self.notify_listeners()
|
|
73
106
|
|
|
107
|
+
def set_initial_dir_named(self, name: str, d: Directory):
|
|
108
|
+
cfg = self._value
|
|
109
|
+
cfg.initial_dir_map[name] = d
|
|
110
|
+
self._value = cfg
|
|
111
|
+
self.notify_listeners()
|
|
112
|
+
|
|
74
113
|
def get_file_config(self) -> File:
|
|
75
114
|
return AppConfigNotifier.file_config
|
|
76
115
|
|
|
77
|
-
def
|
|
78
|
-
final = dict()
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
116
|
+
def config_to_map(self) -> dict[str, Any]:
|
|
117
|
+
final = dict[str, Any]()
|
|
118
|
+
cfg = self.value
|
|
119
|
+
|
|
120
|
+
# Converter initial_dir_map para dict/json
|
|
121
|
+
json_initial_dir_map = dict[str, str]()
|
|
122
|
+
header_initial_dir = cfg.initial_dir_map.header()
|
|
123
|
+
header_initial_dir.for_each(
|
|
124
|
+
lambda h_name: json_initial_dir_map.setdefault(
|
|
125
|
+
h_name, cfg.initial_dir_map.get_value(h_name).absolute()
|
|
126
|
+
)
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
final["initial_dir_map"] = json_initial_dir_map
|
|
130
|
+
final["initial_dir"] = cfg.initial_dir.absolute()
|
|
131
|
+
final["last_dir"] = cfg.last_dir.absolute()
|
|
132
|
+
final["work_dir"] = cfg.work_dir.absolute()
|
|
133
|
+
final["documents_dir"] = cfg.documents_dir.absolute()
|
|
134
|
+
final["theme_mode"] = cfg.theme_mode.value
|
|
84
135
|
return final
|
|
85
136
|
|
|
137
|
+
def get_dict_config(self) -> dict[str, Any]:
|
|
138
|
+
return self.config_to_map()
|
|
139
|
+
|
|
86
140
|
def save_config(self):
|
|
87
141
|
converter = JsonConvert.from_dict(self.get_dict_config())
|
|
88
142
|
converter.data.to_file(self.get_file_config())
|
|
@@ -71,6 +71,21 @@ class ControllerForms(ChangeNotifier):
|
|
|
71
71
|
def get_config(self) -> AppConfigNotifier:
|
|
72
72
|
return Provider.read(AppConfigNotifier)
|
|
73
73
|
|
|
74
|
+
def get_initial_dir(self) -> Directory:
|
|
75
|
+
cfg = self.get_config()
|
|
76
|
+
map_initial_dir = cfg.value.initial_dir_map
|
|
77
|
+
|
|
78
|
+
if map_initial_dir.header().contains("page_forms"):
|
|
79
|
+
return map_initial_dir.get_value("page_forms")
|
|
80
|
+
return cfg.value.initial_dir
|
|
81
|
+
|
|
82
|
+
def set_initial_dir(self, d: Directory):
|
|
83
|
+
k = "page_forms"
|
|
84
|
+
cfg = self.get_config().value
|
|
85
|
+
|
|
86
|
+
cfg.initial_dir_map[k] = d
|
|
87
|
+
self.get_config().value = cfg
|
|
88
|
+
|
|
74
89
|
def show_info(self, i: str) -> None:
|
|
75
90
|
if self.fn_show_info is not None:
|
|
76
91
|
_ui(lambda: self.fn_show_info(i))
|
|
@@ -88,15 +88,18 @@ class _PageRespondsFormsState(StatelessWidget):
|
|
|
88
88
|
self.show_info("Existe um lançamento em andamento.")
|
|
89
89
|
return
|
|
90
90
|
|
|
91
|
-
conf = controller.get_config()
|
|
92
|
-
|
|
91
|
+
# conf = controller.get_config()
|
|
92
|
+
conf_initial_dir = controller.get_initial_dir()
|
|
93
|
+
|
|
94
|
+
self.file_picker.initial_directory = conf_initial_dir.absolute()
|
|
93
95
|
|
|
94
96
|
result: FilePickerResult | None = self.file_picker.pick_files()
|
|
95
97
|
if result is None or not result.files:
|
|
96
98
|
return
|
|
97
99
|
|
|
98
100
|
if self.file_picker.initial_directory is not None:
|
|
99
|
-
conf.set_initial_dir(Directory(self.file_picker.initial_directory))
|
|
101
|
+
# conf.set_initial_dir(Directory(self.file_picker.initial_directory))
|
|
102
|
+
controller.set_initial_dir(Directory(self.file_picker.initial_directory))
|
|
100
103
|
|
|
101
104
|
pf: PlatformFile = result.files[0]
|
|
102
105
|
controller.set_selected_table_toi(File(pf.path))
|
|
@@ -118,6 +121,13 @@ class _PageRespondsFormsState(StatelessWidget):
|
|
|
118
121
|
[
|
|
119
122
|
Row(
|
|
120
123
|
[
|
|
124
|
+
Row(
|
|
125
|
+
[
|
|
126
|
+
ElevatedButton(
|
|
127
|
+
"<- Voltar", lambda: context.navigator.pop()
|
|
128
|
+
),
|
|
129
|
+
]
|
|
130
|
+
),
|
|
121
131
|
ElevatedButton(
|
|
122
132
|
"Gerar tabela (pasta)",
|
|
123
133
|
lambda: self.action_generate_table(controller),
|
|
@@ -148,11 +158,6 @@ class _PageRespondsFormsState(StatelessWidget):
|
|
|
148
158
|
Divider(),
|
|
149
159
|
Expanded(TableOrProgress(running=False, df=df)),
|
|
150
160
|
Divider(),
|
|
151
|
-
Row(
|
|
152
|
-
[
|
|
153
|
-
ElevatedButton("<- Voltar", lambda: context.navigator.pop()),
|
|
154
|
-
]
|
|
155
|
-
),
|
|
156
161
|
]
|
|
157
162
|
)
|
|
158
163
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from .common import FieldError, RenameRequest, ResultRename
|
|
2
|
+
from .progress import ProgressReporter, ProgressState
|
|
3
|
+
from .renderer import DocumentViewer, PageSource, PageSourceFactory
|
|
2
4
|
from .model_image import ModelImage
|
|
3
5
|
from .controller_image import ControllerImage
|
|
4
6
|
from .view_image import PageImage
|
|
@@ -142,7 +142,10 @@ class ResultRename:
|
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
# Extensões aceitas no REGISTRO em cache (o visualizador só abre imagens).
|
|
145
|
-
REGISTER_EXTENSIONS: Final[frozenset[str]] = IMAGE_EXTENSIONS | {".pdf"}
|
|
145
|
+
# REGISTER_EXTENSIONS: Final[frozenset[str]] = IMAGE_EXTENSIONS | {".pdf"}
|
|
146
|
+
# Imagens + PDF: o visualizador e o registro em cache aceitam os mesmos tipos.
|
|
147
|
+
DOCUMENT_EXTENSIONS: Final[frozenset[str]] = IMAGE_EXTENSIONS | {".pdf"}
|
|
148
|
+
REGISTER_EXTENSIONS: Final[frozenset[str]] = DOCUMENT_EXTENSIONS # alias antigo
|
|
146
149
|
|
|
147
150
|
_RE_NAME_UC_TOI: Final = re.compile(r"(\d+)[\s_]+(\d+)")
|
|
148
151
|
_RE_COLLISION: Final = re.compile(r"-\d{1,2}$")
|