This commit is contained in:
2026-03-15 18:24:18 +00:00
commit ecfd77c191
45 changed files with 82720 additions and 0 deletions
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,39 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['vaguatechrelatorios.py'],
pathex=[],
binaries=[],
datas=[('Corpus.docx', '.')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='V-aguatech_Reportcrator',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['icon.ico'],
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,171 @@
This file lists modules PyInstaller was not able to find. This does not
necessarily mean these modules are required for running your program. Both
Python's standard library and 3rd-party Python packages often conditionally
import optional modules, some of which may be available only on certain
platforms.
Types of import:
* top-level: imported at the top-level - look at these first
* conditional: imported within an if-statement
* delayed: imported within a function
* optional: imported within a try-except-statement
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
tracking down the missing module yourself. Thanks!
missing module named pwd - imported by posixpath (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib (delayed, optional), subprocess (delayed, conditional, optional), http.server (delayed, optional), psutil (optional), netrc (delayed, conditional), getpass (delayed)
missing module named grp - imported by shutil (delayed, optional), tarfile (optional), pathlib (delayed, optional), subprocess (delayed, conditional, optional)
missing module named _posixsubprocess - imported by subprocess (conditional), multiprocessing.util (delayed)
missing module named fcntl - imported by subprocess (optional), psutil._compat (delayed, optional), xmlrpc.server (optional)
missing module named urllib.urlopen - imported by urllib (delayed, optional), lxml.html (delayed, optional)
missing module named urllib.urlencode - imported by urllib (delayed, optional), lxml.html (delayed, optional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
missing module named posix - imported by os (conditional, optional), shutil (conditional), importlib._bootstrap_external (conditional), posixpath (optional)
missing module named resource - imported by posix (top-level)
missing module named _posixshmem - imported by multiprocessing.resource_tracker (conditional), multiprocessing.shared_memory (conditional)
missing module named termios - imported by tty (top-level), psutil._compat (delayed, optional), getpass (optional)
missing module named vms_lib - imported by platform (delayed, optional)
missing module named 'java.lang' - imported by platform (delayed, optional)
missing module named java - imported by platform (delayed)
missing module named _winreg - imported by platform (delayed, optional)
missing module named _scproxy - imported by urllib.request (conditional)
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named pyimod02_importers - imported by C:\Users\garci\AppData\Roaming\Python\Python312\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py (delayed)
missing module named collections.Callable - imported by collections (optional), bs4.element (optional), bs4.builder._lxml (optional)
missing module named asyncio.DefaultEventLoopPolicy - imported by asyncio (delayed, conditional), asyncio.events (delayed, conditional)
missing module named annotationlib - imported by typing_extensions (conditional)
missing module named htmlentitydefs - imported by lxml.html.soupparser (optional)
missing module named BeautifulSoup - imported by lxml.html.soupparser (optional)
missing module named chardet - imported by bs4.dammit (optional)
missing module named cchardet - imported by bs4.dammit (optional)
missing module named bs4.builder.HTMLParserTreeBuilder - imported by bs4.builder (top-level), bs4 (top-level)
missing module named 'html5lib.treebuilders' - imported by bs4.builder._html5lib (optional), lxml.html._html5builder (top-level), lxml.html.html5parser (top-level)
missing module named 'html5lib.constants' - imported by bs4.builder._html5lib (top-level)
missing module named html5lib - imported by bs4.builder._html5lib (top-level), lxml.html.html5parser (top-level)
missing module named urlparse - imported by lxml.ElementInclude (optional), lxml.html.html5parser (optional)
missing module named urllib2 - imported by lxml.ElementInclude (optional), lxml.html.html5parser (optional)
missing module named lxml_html_clean - imported by lxml.html.clean (optional)
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional)
missing module named cssselect - imported by lxml.cssselect (optional)
missing module named olefile - imported by PIL.FpxImagePlugin (top-level), PIL.MicImagePlugin (top-level)
missing module named _dummy_thread - imported by numpy.core.arrayprint (optional)
missing module named dummy_threading - imported by psutil._compat (optional)
missing module named numpy.core.result_type - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.float_ - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.number - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.object_ - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.max - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.all - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.errstate - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.bool_ - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.inf - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.isnan - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.array2string - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.lib.imag - imported by numpy.lib (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.lib.real - imported by numpy.lib (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.lib.iscomplexobj - imported by numpy.lib (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.signbit - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.isscalar - imported by numpy.core (delayed), numpy.testing._private.utils (delayed), numpy.lib.polynomial (top-level)
missing module named numpy.core.array - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.isnat - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.ndarray - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.lib.utils (top-level)
missing module named numpy.core.array_repr - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.arange - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.empty - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.float32 - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.intp - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.linspace - imported by numpy.core (top-level), numpy.lib.index_tricks (top-level)
missing module named numpy.core.iinfo - imported by numpy.core (top-level), numpy.lib.twodim_base (top-level)
missing module named numpy.core.transpose - imported by numpy.core (top-level), numpy.lib.function_base (top-level)
missing module named numpy.uint - imported by numpy (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.core.asarray - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.lib.utils (top-level), numpy.fft._pocketfft (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.integer - imported by numpy.core (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.sqrt - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.conjugate - imported by numpy.core (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.swapaxes - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.zeros - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.reciprocal - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.sort - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.argsort - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.sign - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.count_nonzero - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.divide - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.matmul - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.asanyarray - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.atleast_2d - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.prod - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.amax - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.amin - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.moveaxis - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.geterrobj - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.finfo - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.isfinite - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.sum - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.multiply - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.add - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.dot - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.Inf - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.newaxis - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.complexfloating - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.inexact - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.cdouble - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.csingle - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.double - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.single - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.intc - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.empty_like - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named pyodide_js - imported by threadpoolctl (delayed, optional)
missing module named numpy.core.ufunc - imported by numpy.core (top-level), numpy.lib.utils (top-level)
missing module named numpy.core.ones - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.hstack - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.atleast_1d - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.atleast_3d - imported by numpy.core (top-level), numpy.lib.shape_base (top-level)
missing module named numpy.core.vstack - imported by numpy.core (top-level), numpy.lib.shape_base (top-level)
missing module named pickle5 - imported by numpy.compat.py3k (optional)
missing module named numpy.eye - imported by numpy (delayed), numpy.core.numeric (delayed)
missing module named numpy.recarray - imported by numpy (top-level), numpy.lib.recfunctions (top-level), numpy.ma.mrecords (top-level)
missing module named numpy.expand_dims - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.array - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level)
missing module named numpy.iscomplexobj - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.amin - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.amax - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.isinf - imported by numpy (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.isnan - imported by numpy (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.isfinite - imported by numpy (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.float64 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.float32 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.uint64 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random.bit_generator (top-level), numpy.random._philox (top-level), numpy.random._sfc64 (top-level), numpy.random._generator (top-level)
missing module named numpy.uint32 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random.bit_generator (top-level), numpy.random._generator (top-level), numpy.random._mt19937 (top-level)
missing module named numpy.uint16 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.uint8 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.int64 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.int32 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.int16 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.int8 - imported by numpy (top-level), numpy.array_api._typing (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.bytes_ - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.str_ - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.void - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.object_ - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.datetime64 - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.timedelta64 - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.number - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.complexfloating - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.floating - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.integer - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.ctypeslib (top-level)
missing module named numpy.unsignedinteger - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.bool_ - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.ma.core (top-level), numpy.ma.mrecords (top-level), numpy.random.mtrand (top-level), numpy.random._generator (top-level)
missing module named numpy.generic - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.dtype - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.array_api._typing (top-level), numpy.ma.mrecords (top-level), numpy.random.mtrand (top-level), numpy.random.bit_generator (top-level), numpy.random._philox (top-level), numpy.random._sfc64 (top-level), numpy.random._generator (top-level), numpy.random._mt19937 (top-level), numpy.ctypeslib (top-level)
missing module named numpy.ndarray - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.lib.recfunctions (top-level), numpy.ma.mrecords (top-level), numpy.random.mtrand (top-level), numpy.random.bit_generator (top-level), numpy.random._philox (top-level), numpy.random._sfc64 (top-level), numpy.random._generator (top-level), numpy.random._mt19937 (top-level), numpy.ctypeslib (top-level)
missing module named numpy.ufunc - imported by numpy (top-level), numpy._typing (top-level), numpy.testing.overrides (top-level)
missing module named numpy.histogramdd - imported by numpy (delayed), numpy.lib.twodim_base (delayed)
missing module named numpy._distributor_init_local - imported by numpy (optional), numpy._distributor_init (optional)
missing module named numpy._typing._ufunc - imported by numpy._typing (conditional)
missing module named xmlrpclib - imported by defusedxml.xmlrpc (conditional)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,247 @@
This file lists modules PyInstaller was not able to find. This does not
necessarily mean these modules are required for running your program. Both
Python's standard library and 3rd-party Python packages often conditionally
import optional modules, some of which may be available only on certain
platforms.
Types of import:
* top-level: imported at the top-level - look at these first
* conditional: imported within an if-statement
* delayed: imported within a function
* optional: imported within a try-except-statement
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
tracking down the missing module yourself. Thanks!
missing module named pwd - imported by posixpath (delayed, conditional, optional), subprocess (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib (optional), netrc (delayed, optional), http.server (delayed, optional), psutil (optional)
missing module named grp - imported by subprocess (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib (optional)
missing module named 'collections.abc' - imported by tracemalloc (top-level), typing (top-level), traceback (top-level), _colorize (top-level), selectors (top-level), logging (top-level), http.client (top-level), importlib.resources.readers (top-level), inspect (top-level), typing_extensions (top-level), asyncio.base_events (top-level), multiprocessing.managers (top-level), asyncio.coroutines (top-level), PIL.Image (top-level), PIL._typing (top-level), numpy._typing._array_like (top-level), numpy._typing._nested_sequence (conditional), numpy._typing._shape (top-level), numpy._typing._dtype_like (top-level), numpy.lib._function_base_impl (top-level), _pyrepl.types (top-level), numpy.lib._npyio_impl (top-level), numpy.random._common (top-level), numpy.random._generator (top-level), numpy.random.bit_generator (top-level), numpy.random.mtrand (top-level), numpy.polynomial._polybase (top-level), xml.etree.ElementTree (top-level), PIL.TiffImagePlugin (top-level), PIL.ImageOps (top-level), PIL.ImagePalette (top-level), PIL.GimpGradientFile (conditional), PIL.ImageFilter (top-level), PIL.ImageQt (conditional), PIL.ImageMath (conditional), PIL.ImageSequence (conditional), PIL.PngImagePlugin (conditional), lxml.html (top-level), lxml.html._setmixin (optional), PIL.Jpeg2KImagePlugin (conditional)
missing module named _posixsubprocess - imported by subprocess (conditional), multiprocessing.util (delayed)
missing module named fcntl - imported by subprocess (optional), pathlib._os (optional)
missing module named urllib.urlopen - imported by urllib (delayed, optional), lxml.html (delayed, optional)
missing module named urllib.urlencode - imported by urllib (delayed, optional), lxml.html (delayed, optional)
missing module named _scproxy - imported by urllib.request (conditional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
missing module named posix - imported by os (conditional, optional), posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), pathlib._os (optional), _pyrepl.trace (conditional)
missing module named resource - imported by posix (top-level)
missing module named _posixshmem - imported by multiprocessing.resource_tracker (conditional), multiprocessing.shared_memory (conditional)
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.forkserver (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named pyimod02_importers - imported by C:\Users\garci\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py (delayed)
missing module named htmlentitydefs - imported by lxml.html.soupparser (optional)
missing module named BeautifulSoup - imported by lxml.html.soupparser (optional)
missing module named cchardet - imported by bs4.dammit (optional)
missing module named 'html5lib.treebuilders' - imported by bs4.builder._html5lib (top-level), lxml.html._html5builder (top-level), lxml.html.html5parser (top-level)
missing module named 'html5lib.constants' - imported by bs4.builder._html5lib (top-level)
missing module named html5lib - imported by bs4.builder._html5lib (top-level), lxml.html.html5parser (top-level)
missing module named urlparse - imported by lxml.ElementInclude (optional), lxml.html.html5parser (optional)
missing module named urllib2 - imported by lxml.ElementInclude (optional), lxml.html.html5parser (optional)
missing module named 'cython.cimports' - imported by lxml.html.diff (optional)
missing module named cython - imported by lxml.html.diff (optional), lxml.html._difflib (optional)
missing module named lxml_html_clean - imported by lxml.html.clean (optional)
missing module named cgi - imported by lxml.doctestcompare (optional)
missing module named termios - imported by tty (top-level), _pyrepl.pager (delayed, optional)
missing module named vms_lib - imported by platform (delayed, optional)
missing module named 'java.lang' - imported by platform (delayed, optional)
missing module named java - imported by platform (delayed)
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, conditional, optional), rlcompleter (optional)
missing module named cssselect - imported by lxml.cssselect (optional)
missing module named olefile - imported by PIL.FpxImagePlugin (top-level), PIL.MicImagePlugin (top-level)
missing module named _dummy_thread - imported by numpy._core.arrayprint (optional)
missing module named 'numpy_distutils.cpuinfo' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
missing module named 'numpy_distutils.fcompiler' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
missing module named 'numpy_distutils.command' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
missing module named numpy_distutils - imported by numpy.f2py.diagnose (delayed, optional)
missing module named _typeshed - imported by numpy.random.bit_generator (top-level)
missing module named numpy.random.RandomState - imported by numpy.random (top-level), numpy.random._generator (top-level)
missing module named threadpoolctl - imported by numpy.lib._utils_impl (delayed, optional)
missing module named numpy._core.zeros - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.vstack - imported by numpy._core (top-level), numpy.lib._shape_base_impl (top-level), numpy (conditional)
missing module named numpy._core.void - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.vecmat - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.vecdot - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.ushort - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.unsignedinteger - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.ulonglong - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.ulong - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.uintp - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.uintc - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.uint64 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.uint32 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.uint16 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.uint - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.ubyte - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.trunc - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.true_divide - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.transpose - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._function_base_impl (top-level), numpy (conditional)
missing module named numpy._core.trace - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.timedelta64 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.tensordot - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.tanh - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.tan - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.swapaxes - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.sum - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.subtract - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.str_ - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.square - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.sqrt - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional), numpy.fft._pocketfft (top-level)
missing module named numpy._core.spacing - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.sort - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.sinh - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.single - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.signedinteger - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.signbit - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.sign - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.short - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.rint - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.right_shift - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.result_type - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional), numpy.fft._pocketfft (top-level)
missing module named numpy._core.remainder - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.reciprocal - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional), numpy.fft._pocketfft (top-level)
missing module named numpy._core.radians - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.rad2deg - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.prod - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.power - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.positive - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.pi - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.outer - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.ones - imported by numpy._core (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
missing module named numpy._core.object_ - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.number - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.not_equal - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.nextafter - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.newaxis - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.negative - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.ndarray - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy.lib._utils_impl (top-level), numpy (conditional)
missing module named numpy._core.multiply - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.moveaxis - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.modf - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.mod - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.minimum - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.maximum - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.max - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.matvec - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.matrix_transpose - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.matmul - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.longlong - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.longdouble - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.long - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.logical_xor - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.logical_or - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.logical_not - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.logical_and - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.logaddexp2 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.logaddexp - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.log10 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.log2 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.log1p - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.log - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.linspace - imported by numpy._core (top-level), numpy.lib._index_tricks_impl (top-level), numpy (conditional)
missing module named numpy._core.less_equal - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.less - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.left_shift - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.ldexp - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.lcm - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.isscalar - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy.lib._polynomial_impl (top-level), numpy (conditional)
missing module named numpy._core.isnat - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional)
missing module named numpy._core.isnan - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.isfinite - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.intp - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.integer - imported by numpy._core (conditional), numpy (conditional), numpy.fft._helper (top-level)
missing module named numpy._core.intc - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.int64 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.int32 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.int16 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.int8 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.inf - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.inexact - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.iinfo - imported by numpy._core (top-level), numpy.lib._twodim_base_impl (top-level), numpy (conditional)
missing module named numpy._core.hypot - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.hstack - imported by numpy._core (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
missing module named numpy._core.heaviside - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.half - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.greater_equal - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.greater - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.gcd - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.frompyfunc - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.frexp - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.fmod - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.fmin - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.fmax - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.floor_divide - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.floor - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.floating - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.float_power - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.float32 - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.float16 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.finfo - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
missing module named numpy._core.fabs - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.expm1 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.exp2 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.exp - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.euler_gamma - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.errstate - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.equal - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.empty_like - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional), numpy.fft._pocketfft (top-level)
missing module named numpy._core.empty - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy.fft._helper (top-level)
missing module named numpy._core.e - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.double - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.dot - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
missing module named numpy._core.divmod - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.divide - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.diagonal - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.degrees - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.deg2rad - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.datetime64 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.csingle - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.cross - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.count_nonzero - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.cosh - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.cos - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.copysign - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.conjugate - imported by numpy._core (conditional), numpy (conditional), numpy.fft._pocketfft (top-level)
missing module named numpy._core.conj - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.complexfloating - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.complex64 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
missing module named numpy._core.clongdouble - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.character - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.ceil - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.cdouble - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.cbrt - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.bytes_ - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.byte - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.bool_ - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.bitwise_xor - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.bitwise_or - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.bitwise_count - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.bitwise_and - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.atleast_3d - imported by numpy._core (top-level), numpy.lib._shape_base_impl (top-level), numpy (conditional)
missing module named numpy._core.atleast_2d - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.atleast_1d - imported by numpy._core (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
missing module named numpy._core.asarray - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._array_utils_impl (top-level), numpy (conditional), numpy.fft._helper (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy._core.asanyarray - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.array_repr - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional)
missing module named numpy._core.array2string - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.array - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
missing module named numpy._core.argsort - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.arctanh - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.arctan2 - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.arctan - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.arcsinh - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.arcsin - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.arccosh - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.arccos - imported by numpy._core (conditional), numpy (conditional)
missing module named numpy._core.arange - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy.fft._helper (top-level)
missing module named numpy._core.amin - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.amax - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named numpy._core.all - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
missing module named numpy._core.add - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
missing module named yaml - imported by numpy.__config__ (delayed)
missing module named numpy._distributor_init_local - imported by numpy (optional), numpy._distributor_init (optional)
missing module named defusedxml - imported by PIL.Image (optional)
File diff suppressed because it is too large Load Diff
+35
View File
@@ -0,0 +1,35 @@
@echo off
setlocal
cd /d "%~dp0"
if not exist "icon.png" (
echo ERRO: "icon.png" nao encontrado na pasta atual.
echo Coloque a imagem do logo como "icon.png" nesta pasta e execute novamente.
exit /b 1
)
echo A gerar icon.ico...
python -c "from PIL import Image; img=Image.open('icon.png'); img.save('icon.ico', sizes=[(256,256)])"
if errorlevel 1 (
echo ERRO: Falha ao gerar icon.ico. Verifique se o Pillow esta instalado.
exit /b 1
)
echo A instalar/atualizar PyInstaller...
python -m pip install --upgrade pyinstaller
if errorlevel 1 (
echo ERRO: Falha ao instalar PyInstaller.
exit /b 1
)
echo A compilar o executavel...
python -m PyInstaller --noconsole --onefile --name "V-aguatech_Reportcrator" --icon "icon.ico" --add-data "Corpus.docx;." vaguatechrelatorios.py
if errorlevel 1 (
echo ERRO: Falha ao compilar o executavel.
exit /b 1
)
echo.
echo SUCESSO: Executavel gerado em "dist\V-aguatech_Reportcrator.exe"
endlocal
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

+43
View File
@@ -0,0 +1,43 @@
import tkinter as tk
from tkinter import ttk
class App(tk.Tk):
def __init__(self):
super().__init__()
self.title("Navegacao entre Modulos")
self.geometry("900x550")
sidebar = ttk.Frame(self, padding=10)
sidebar.pack(side="left", fill="y")
self.content = ttk.Frame(self, padding=16)
self.content.pack(side="left", fill="both", expand=True)
self.frames = {
"Modulo 1": self._build_page("Modulo 1", "Conteudo do modulo 1"),
"Modulo 2": self._build_page("Modulo 2", "Conteudo do modulo 2"),
"Modulo 3": self._build_page("Modulo 3", "Conteudo do modulo 3"),
}
for nome in self.frames:
ttk.Button(sidebar, text=nome, command=lambda n=nome: self.show_page(n)).pack(
fill="x", pady=4
)
self.show_page("Modulo 1")
def _build_page(self, titulo: str, texto: str) -> ttk.Frame:
frame = ttk.Frame(self.content)
ttk.Label(frame, text=titulo, font=("Segoe UI", 16, "bold")).pack(anchor="w")
ttk.Label(frame, text=texto).pack(anchor="w", pady=(10, 0))
return frame
def show_page(self, nome: str):
for frame in self.frames.values():
frame.pack_forget()
self.frames[nome].pack(fill="both", expand=True)
if __name__ == "__main__":
App().mainloop()
+778
View File
@@ -0,0 +1,778 @@
import os
import sys
import tkinter as tk
from tkinter import ttk
from datetime import datetime
from docx import Document
from tkinter import filedialog
from PIL import Image
import tempfile
from docx.shared import Inches, Pt, RGBColor
import io
TEMPLATE_DOCX = "Corpus.docx"
def resource_path(relative_path: str) -> str:
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
def image_to_png_stream(image_path: str) -> io.BytesIO:
with Image.open(image_path) as img:
if img.mode not in ("RGB", "RGBA"):
img = img.convert("RGB")
bio = io.BytesIO()
img.save(bio, format="PNG")
bio.seek(0)
return bio
def insert_image_at_placeholder(doc: Document, placeholder: str, image_path: str, width_inches: float = 6.20) -> bool:
if not image_path or not os.path.exists(image_path):
return False
try:
img_stream = image_to_png_stream(image_path)
except Exception as e:
raise ValueError(f"Não consegui abrir/convert a imagem:\n{image_path}\n\nDetalhes:\n{e}")
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
run = p.add_run()
run.add_picture(img_stream, width=Inches(width_inches))
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def insert_images_at_placeholders(doc: Document, placeholders: dict, width_inches: float = 6.20) -> list:
missing = []
for placeholder, image_path in placeholders.items():
if not image_path:
continue
ok = insert_image_at_placeholder(doc, placeholder, image_path, width_inches=width_inches)
if not ok:
missing.append(placeholder)
return missing
def insert_tecnicas_utilizadas(doc: Document, placeholder: str, tecnicas: list) -> bool:
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
first_block = True
for t in tecnicas:
if not t.get("selected"):
continue
nome = (t.get("name") or "").strip()
desc = (t.get("desc") or "").strip()
fotos = t.get("photos") or []
if not nome:
continue
if not first_block:
p.add_run().add_break()
p.add_run().add_break()
run_title = p.add_run(nome)
run_title.font.name = "Verdana"
run_title.font.size = Pt(11)
run_title.font.color.rgb = RGBColor(0x4A, 0x66, 0xAC)
p.add_run().add_break()
if desc:
run_desc = p.add_run(desc)
run_desc.font.name = "Verdana"
run_desc.font.size = Pt(10)
run_desc.font.color.rgb = RGBColor(0x66, 0x66, 0x66)
p.add_run().add_break()
if fotos:
for i, image_path in enumerate(fotos):
if not image_path or not os.path.exists(image_path):
continue
try:
img_stream = image_to_png_stream(image_path)
except Exception as e:
raise ValueError(f"Não consegui abrir/convert a imagem:\n{image_path}\n\nDetalhes:\n{e}")
run_img = p.add_run()
run_img.add_picture(img_stream, width=Inches(2.80))
is_last = i == len(fotos) - 1
if not is_last:
if i % 2 == 0:
p.add_run(" ")
else:
p.add_run().add_break()
p.add_run().add_break()
first_block = False
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def insert_metodos_utilizados(doc: Document, placeholder: str, values: dict) -> bool:
items = []
seen = set()
for group_key in ("inicio_pesquisa", "tecnicas"):
for t in values.get(group_key) or []:
if not t.get("selected"):
continue
name = (t.get("name") or "").strip()
if not name or name in seen:
continue
seen.add(name)
items.append(name)
if not items:
return False
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
for i, name in enumerate(items):
run = p.add_run(f"- {name}")
run.font.name = "Verdana"
run.font.size = Pt(10)
run.font.color.rgb = RGBColor(0x66, 0x66, 0x66)
if i < len(items) - 1:
p.add_run().add_break()
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def insert_multiple_images_at_placeholder(doc: Document, placeholder: str, image_paths: list, width_inches: float = 2.80) -> bool:
if not image_paths:
return False
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
for i, image_path in enumerate(image_paths):
if not image_path or not os.path.exists(image_path):
continue
try:
img_stream = image_to_png_stream(image_path)
except Exception as e:
raise ValueError(f"Não consegui abrir/convert a imagem:\n{image_path}\n\nDetalhes:\n{e}")
run = p.add_run()
run.add_picture(img_stream, width=Inches(width_inches))
is_last = i == len(image_paths) - 1
if not is_last:
if i % 2 == 0:
p.add_run(" ")
else:
p.add_run().add_break()
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def fatal_popup_and_exit(title: str, msg: str, exit_code: int = 1):
win = tk.Tk()
win.title(title)
win.geometry("520x260")
win.resizable(False, False)
frm = ttk.Frame(win, padding=14)
frm.pack(fill="both", expand=True)
ttk.Label(frm, text=title, font=("Segoe UI", 12, "bold")).pack(anchor="w", pady=(0, 8))
txt = tk.Text(frm, height=8, wrap="word")
txt.pack(fill="both", expand=True)
txt.insert("1.0", msg)
txt.config(state="disabled")
def close_and_exit():
win.destroy()
raise SystemExit(exit_code)
ttk.Button(frm, text="OK", command=close_and_exit).pack(anchor="e", pady=(10, 0))
win.protocol("WM_DELETE_WINDOW", close_and_exit)
win.mainloop()
def info_popup(title: str, msg: str):
win = tk.Toplevel()
win.title(title)
win.geometry("520x240")
win.resizable(False, False)
frm = ttk.Frame(win, padding=14)
frm.pack(fill="both", expand=True)
ttk.Label(frm, text=title, font=("Segoe UI", 12, "bold")).pack(anchor="w", pady=(0, 8))
txt = tk.Text(frm, height=7, wrap="word")
txt.pack(fill="both", expand=True)
txt.insert("1.0", msg)
txt.config(state="disabled")
def close():
win.destroy()
ttk.Button(frm, text="OK", command=close).pack(anchor="e", pady=(10, 0))
win.grab_set()
win.focus_force()
def replace_placeholders_in_doc(doc: Document, mapping: dict) -> None:
for p in doc.paragraphs:
text = p.text
new_text = text
for k, v in mapping.items():
new_text = new_text.replace(k, v)
if new_text != text:
p.text = new_text
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
text = p.text
new_text = text
for k, v in mapping.items():
new_text = new_text.replace(k, v)
if new_text != text:
p.text = new_text
def generate_output_filename() -> str:
stamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
return f"{stamp}.docx"
def build_presence_text(values: dict) -> str:
parts = []
present_people = []
presencas = values.get("presencas") or []
# Retrocompatibilidade com o formato antigo (um item por tipo)
if not presencas:
if values.get("segurado_presente"):
presencas.append(
{
"tipo": "segurado",
"nome": values.get("segurado_nome"),
"info": values.get("segurado_info"),
}
)
if values.get("lesado_presente"):
presencas.append(
{
"tipo": "lesado",
"nome": values.get("lesado_nome"),
"info": values.get("lesado_info"),
}
)
if values.get("outro_presente"):
presencas.append(
{
"tipo": "outro",
"nome": values.get("outro_nome"),
"info": values.get("outro_info"),
}
)
def join_people(items: list) -> str:
if not items:
return ""
if len(items) == 1:
return items[0]
return ", ".join(items[:-1]) + " e " + items[-1]
for item in presencas:
tipo = (item.get("tipo") or "").strip().lower()
nome = (item.get("nome") or "").strip()
info = (item.get("info") or "").strip()
if not nome:
continue
if tipo == "segurado":
present_people.append(f"o segurado, {nome}")
if info:
parts.append(f"O segurado, {nome} informou que {info}.")
elif tipo == "lesado":
present_people.append(f"o lesado, {nome}")
if info:
parts.append(f"O lesado, {nome} informou que {info}.")
else:
present_people.append(nome)
if info:
parts.append(f"{nome} informou que {info}.")
header = ""
if present_people:
joined = join_people(present_people)
if len(present_people) == 1:
header = f"{joined} esteve presente aquando a pesquisa."
else:
header = f"{joined} estiveram presentes aquando a pesquisa."
if header and parts:
return header + "\n\n" + "\n".join(parts)
if header:
return header
if parts:
return "\n".join(parts)
return ""
def run_generation(values: dict, root: tk.Tk):
mapping = {
"{{nproc}}": (values.get("nproc") or "").strip(),
"{{segurado}}": (values.get("segurado") or "").strip(),
"{{comp}}": (values.get("comp") or "").strip(),
"{{terceiro}}": (values.get("terceiro") or "").strip(),
"{{data}}": (values.get("data") or "").strip(),
"{{local da visita}}": (values.get("local") or "").strip(),
"{{descriçãoimovel}}": (values.get("descriçãoimovel") or "").strip(),
"{{anoconstr}}": (values.get("anoconstr") or "").strip(),
"{{presencas}}": build_presence_text(values),
"{{descricao}}": (values.get("descricao") or "").strip(),
"{{area}}": (values.get("area") or "").strip(),
}
template_path = resource_path(TEMPLATE_DOCX)
if not os.path.exists(template_path):
try:
root.destroy()
except Exception:
pass
fatal_popup_and_exit(
"Erro: template não encontrado",
f"Não encontrei o template '{TEMPLATE_DOCX}'.\n\n"
f"Coloca o ficheiro '{TEMPLATE_DOCX}' na mesma pasta do executável e volta a executar."
)
return
output_docx = generate_output_filename()
try:
doc = Document(template_path)
replace_placeholders_in_doc(doc, mapping)
foto1_path = (values.get("foto1_path") or "").strip()
fotos2_paths = values.get("fotos2_paths") or []
placeholders = {
"{{foto1}}": foto1_path,
}
missing = insert_images_at_placeholders(doc, placeholders, width_inches=6.20)
if missing:
info_popup(
"Aviso",
"Não encontrei os placeholders no template (corpo/cabeçalho/rodapé):\n"
+ ", ".join(missing)
)
if fotos2_paths:
ok_multi = insert_multiple_images_at_placeholder(doc, "{{foto2}}", fotos2_paths, width_inches=2.80)
if not ok_multi:
info_popup(
"Aviso",
"Não encontrei o placeholder {{foto2}} no template (corpo/cabeçalho/rodapé)."
)
tecnicas = values.get("tecnicas") or []
if tecnicas:
ok_tecnicas = insert_tecnicas_utilizadas(doc, "{{tecnicasutilizadas}}", tecnicas)
if not ok_tecnicas:
info_popup(
"Aviso",
"Não encontrei o placeholder {{tecnicasutilizadas}} no template (corpo/cabeçalho/rodapé)."
)
inicio_pesquisa = values.get("inicio_pesquisa") or []
if inicio_pesquisa:
ok_inicio = insert_tecnicas_utilizadas(doc, "{{iniciopesquisa}}", inicio_pesquisa)
if not ok_inicio:
info_popup(
"Aviso",
"Não encontrei o placeholder {{iniciopesquisa}} no template (corpo/cabeçalho/rodapé)."
)
if values.get("inicio_pesquisa") or values.get("tecnicas"):
ok_metodos = insert_metodos_utilizados(doc, "{{metodosutilizados}}", values)
if not ok_metodos:
info_popup(
"Aviso",
"Não encontrei o placeholder {{metodosutilizados}} no template (corpo/cabeçalho/rodapé)."
)
doc.save(output_docx)
info_popup("Sucesso", f"Documento gerado com sucesso:\n\n{output_docx}")
except Exception as e:
try:
root.destroy()
except Exception:
pass
fatal_popup_and_exit(
"Erro ao gerar documento",
f"Falhou ao gerar o documento.\n\nDetalhes:\n{e}"
)
def choose_image(foto_var):
path = filedialog.askopenfilename(
title="Selecionar fotografia",
filetypes=[
("Imagens", "*.png *.jpg *.jpeg *.bmp"),
("Todos os ficheiros", "*.*"),
],
)
if path:
foto_var.set(path)
def choose_images(fotos_var, label_var):
paths = filedialog.askopenfilenames(
title="Selecionar fotografias",
filetypes=[
("Imagens", "*.png *.jpg *.jpeg *.bmp"),
("Todos os ficheiros", "*.*"),
],
)
if paths:
fotos_var.set(list(paths))
label_var.set(f"{len(paths)} imagem(ns)")
def main():
root = tk.Tk()
root.title("Preencher Corpus (Word)")
root.geometry("1120x640")
root.resizable(False, False)
outer = ttk.Frame(root)
outer.pack(fill="both", expand=True)
canvas = tk.Canvas(outer, highlightthickness=0)
scrollbar = ttk.Scrollbar(outer, orient="vertical", command=canvas.yview)
canvas.configure(yscrollcommand=scrollbar.set)
scrollbar.pack(side="right", fill="y")
canvas.pack(side="left", fill="both", expand=True)
frm = ttk.Frame(canvas, padding=16)
canvas_window = canvas.create_window((0, 0), window=frm, anchor="nw")
def _update_scrollregion(_event=None):
canvas.configure(scrollregion=canvas.bbox("all"))
def _fit_inner_width(event):
canvas.itemconfigure(canvas_window, width=event.width)
def _on_mousewheel(event):
canvas.yview_scroll(int(-1 * (event.delta / 120)), "units")
frm.bind("<Configure>", _update_scrollregion)
canvas.bind("<Configure>", _fit_inner_width)
canvas.bind_all("<MouseWheel>", _on_mousewheel)
fields = [("Nº do Processo:", "nproc"),("Segurado:", "segurado"),
("Companhia:", "comp"),
("Terceiro:", "terceiro"),
("Data da visita:", "data"),
("Local da visita:", "local"),
("Descrição do imóvel:", "descriçãoimovel"),
("Ano de Construção:", "anoconstr"),
("Descrição da pesquisa:", "descricao"),
("Área do do espaço:", "area")
]
entries = {}
foto_var = tk.StringVar(value="")
fotos2_var = tk.Variable(value=[])
fotos2_label = tk.StringVar(value="")
tecnicas_data = []
inicio_data = []
for i, (label, key) in enumerate(fields):
ttk.Label(frm, text=label).grid(row=i, column=0, sticky="w", pady=6)
ent = ttk.Entry(frm, width=80)
ent.grid(row=i, column=1, sticky="w", pady=6)
entries[key] = ent
if key == "descriçãoimovel":
ttk.Button(
frm,
text="Escolher imagem…",
command=lambda: choose_image(foto_var)
).grid(row=i, column=2, sticky="w", padx=8)
ttk.Label(
frm,
textvariable=foto_var,
width=28
).grid(row=i, column=4, sticky="w")
if key == "descricao":
ttk.Button(
frm,
text="Escolher imagens…",
command=lambda: choose_images(fotos2_var, fotos2_label)
).grid(row=i, column=2, sticky="w", padx=8)
ttk.Label(
frm,
textvariable=fotos2_label,
width=14
).grid(row=i, column=4, sticky="w")
def build_tecnicas_window(title: str, data_list: list):
win = tk.Toplevel(root)
win.title(title)
win.geometry("980x520")
win.resizable(False, False)
container = ttk.Frame(win, padding=16)
container.pack(fill="both", expand=True)
if not data_list:
tecnicas_list = [
"Controlo Visual",
"Medição de humidade",
"Câmara térmica",
"Câmara endoscópica",
"Obturação",
"Teste de pressão",
"Teste com corantes",
]
for nome in tecnicas_list:
data_list.append({
"name": nome,
"var": tk.BooleanVar(value=False),
"desc": tk.StringVar(value=""),
"photos": tk.Variable(value=[]),
"label": tk.StringVar(value=""),
})
def set_row_state(row_widgets, enabled: bool):
state = "normal" if enabled else "disabled"
for w in row_widgets:
w.configure(state=state)
for idx, item in enumerate(data_list):
row = ttk.Frame(container)
row.pack(fill="x", pady=6)
chk = ttk.Checkbutton(
row,
text=item["name"],
variable=item["var"],
command=lambda it=item: set_row_state(it["widgets"], it["var"].get())
)
chk.grid(row=0, column=0, sticky="w")
ttk.Label(row, text="Descrição:").grid(row=0, column=1, sticky="w", padx=(12, 4))
entry = ttk.Entry(row, textvariable=item["desc"], width=50)
entry.grid(row=0, column=2, sticky="w")
btn = ttk.Button(
row,
text="Escolher fotos…",
command=lambda it=item: choose_images(it["photos"], it["label"])
)
btn.grid(row=0, column=3, sticky="w", padx=10)
lbl = ttk.Label(row, textvariable=item["label"], width=18)
lbl.grid(row=0, column=4, sticky="w")
item["widgets"] = [entry, btn]
set_row_state(item["widgets"], item["var"].get())
ttk.Button(container, text="Fechar", command=win.destroy).pack(anchor="e", pady=(12, 0))
win.grab_set()
win.focus_force()
ttk.Button(
frm,
text="Técnicas utilizadas…",
command=lambda: build_tecnicas_window("Técnicas utilizadas", tecnicas_data)
).grid(row=len(fields), column=0, sticky="w", pady=(14, 0))
ttk.Button(
frm,
text="Início da pesquisa…",
command=lambda: build_tecnicas_window("Início da pesquisa", inicio_data)
).grid(row=len(fields), column=1, sticky="w", pady=(14, 0), padx=(12, 0))
presence_frame = ttk.LabelFrame(frm, text="Presenças na pesquisa", padding=12)
presence_frame.grid(row=len(fields) + 1, column=0, columnspan=4, sticky="w", pady=(12, 6))
presenca_rows = {
"segurado": [],
"lesado": [],
"outro": [],
}
type_frames = {}
type_labels = {
"segurado": "segurado",
"lesado": "lesado",
"outro": "outro",
}
def remove_presence_row(tipo: str, row_data: dict):
row_data["frame"].destroy()
presenca_rows[tipo] = [r for r in presenca_rows[tipo] if r is not row_data]
def add_presence_row(tipo: str):
container = type_frames[tipo]
row = ttk.Frame(container)
row.pack(fill="x", pady=3)
nome_var = tk.StringVar(value="")
info_var = tk.StringVar(value="")
ttk.Label(row, text=f"Nome do {type_labels[tipo]}:").grid(row=0, column=0, sticky="w")
ttk.Entry(row, textvariable=nome_var, width=30).grid(row=0, column=1, sticky="w", padx=6)
ttk.Label(row, text="Declaraçoes:").grid(row=0, column=2, sticky="w", padx=(12, 0))
ttk.Entry(row, textvariable=info_var, width=42).grid(row=0, column=3, sticky="w", padx=6)
row_data = {
"frame": row,
"nome": nome_var,
"info": info_var,
}
ttk.Button(
row,
text="Remover",
command=lambda t=tipo, d=row_data: remove_presence_row(t, d)
).grid(row=0, column=4, sticky="w", padx=(8, 0))
presenca_rows[tipo].append(row_data)
def build_presence_section(parent, row_index: int, tipo: str, titulo: str):
sec = ttk.Frame(parent)
sec.grid(row=row_index, column=0, sticky="w", pady=4)
ttk.Label(sec, text=titulo).grid(row=0, column=0, sticky="w")
ttk.Button(
sec,
text=f"Adicionar {type_labels[tipo]}",
command=lambda t=tipo: add_presence_row(t)
).grid(row=0, column=1, sticky="w", padx=(10, 0))
container = ttk.Frame(sec)
container.grid(row=1, column=0, columnspan=2, sticky="w", pady=(6, 0))
type_frames[tipo] = container
build_presence_section(presence_frame, 0, "segurado", "Segurados")
build_presence_section(presence_frame, 1, "lesado", "Lesados")
build_presence_section(presence_frame, 2, "outro", "Outros")
add_presence_row("segurado")
def on_generate():
values = {k: e.get() for k, e in entries.items()}
values["foto1_path"] = foto_var.get()
values["fotos2_paths"] = list(fotos2_var.get()) if fotos2_var.get() else []
values["tecnicas"] = [
{
"name": t["name"],
"selected": t["var"].get(),
"desc": t["desc"].get(),
"photos": list(t["photos"].get()) if t["photos"].get() else [],
}
for t in tecnicas_data
]
values["inicio_pesquisa"] = [
{
"name": t["name"],
"selected": t["var"].get(),
"desc": t["desc"].get(),
"photos": list(t["photos"].get()) if t["photos"].get() else [],
}
for t in inicio_data
]
values["presencas"] = []
for tipo in ("segurado", "lesado", "outro"):
for row in presenca_rows[tipo]:
values["presencas"].append(
{
"tipo": tipo,
"nome": row["nome"].get(),
"info": row["info"].get(),
}
)
run_generation(values, root)
btns = ttk.Frame(frm)
btns.grid(row=len(fields) + 2, column=0, columnspan=2, sticky="w", pady=(18, 0))
ttk.Button(btns, text="Gerar Word", command=on_generate).pack(side="left")
ttk.Button(btns, text="Sair", command=root.destroy).pack(side="left", padx=10)
root.mainloop()
if __name__ == "__main__":
main()
@@ -0,0 +1,39 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['d:\\Trabalhos\\V-aguatech\\Vitor\\vaguatechrelatorios.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='vaguatechrelatorios',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['d:\\Trabalhos\\V-aguatech\\Vitor\\icon.ico'],
)
@@ -0,0 +1,754 @@
import os
import sys
import tkinter as tk
from tkinter import ttk
from datetime import datetime
from docx import Document
from tkinter import filedialog
from PIL import Image
import tempfile
from docx.shared import Inches, Pt, RGBColor
import io
TEMPLATE_DOCX = "Corpus.docx"
def resource_path(relative_path: str) -> str:
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
def image_to_png_stream(image_path: str) -> io.BytesIO:
with Image.open(image_path) as img:
if img.mode not in ("RGB", "RGBA"):
img = img.convert("RGB")
bio = io.BytesIO()
img.save(bio, format="PNG")
bio.seek(0)
return bio
def insert_image_at_placeholder(doc: Document, placeholder: str, image_path: str, width_inches: float = 6.20) -> bool:
if not image_path or not os.path.exists(image_path):
return False
try:
img_stream = image_to_png_stream(image_path)
except Exception as e:
raise ValueError(f"Não consegui abrir/convert a imagem:\n{image_path}\n\nDetalhes:\n{e}")
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
run = p.add_run()
run.add_picture(img_stream, width=Inches(width_inches))
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def insert_images_at_placeholders(doc: Document, placeholders: dict, width_inches: float = 6.20) -> list:
missing = []
for placeholder, image_path in placeholders.items():
if not image_path:
continue
ok = insert_image_at_placeholder(doc, placeholder, image_path, width_inches=width_inches)
if not ok:
missing.append(placeholder)
return missing
def insert_tecnicas_utilizadas(doc: Document, placeholder: str, tecnicas: list) -> bool:
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
first_block = True
for t in tecnicas:
if not t.get("selected"):
continue
nome = (t.get("name") or "").strip()
desc = (t.get("desc") or "").strip()
fotos = t.get("photos") or []
if not nome:
continue
if not first_block:
p.add_run().add_break()
p.add_run().add_break()
run_title = p.add_run(nome)
run_title.font.name = "Verdana"
run_title.font.size = Pt(11)
run_title.font.color.rgb = RGBColor(0x4A, 0x66, 0xAC)
p.add_run().add_break()
if desc:
run_desc = p.add_run(desc)
run_desc.font.name = "Verdana"
run_desc.font.size = Pt(10)
run_desc.font.color.rgb = RGBColor(0x66, 0x66, 0x66)
p.add_run().add_break()
if fotos:
for i, image_path in enumerate(fotos):
if not image_path or not os.path.exists(image_path):
continue
try:
img_stream = image_to_png_stream(image_path)
except Exception as e:
raise ValueError(f"Não consegui abrir/convert a imagem:\n{image_path}\n\nDetalhes:\n{e}")
run_img = p.add_run()
run_img.add_picture(img_stream, width=Inches(2.80))
is_last = i == len(fotos) - 1
if not is_last:
if i % 2 == 0:
p.add_run(" ")
else:
p.add_run().add_break()
p.add_run().add_break()
first_block = False
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def insert_metodos_utilizados(doc: Document, placeholder: str, values: dict) -> bool:
items = []
seen = set()
for group_key in ("inicio_pesquisa", "tecnicas"):
for t in values.get(group_key) or []:
if not t.get("selected"):
continue
name = (t.get("name") or "").strip()
if not name or name in seen:
continue
seen.add(name)
items.append(name)
if not items:
return False
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
for i, name in enumerate(items):
run = p.add_run(f"- {name}")
run.font.name = "Verdana"
run.font.size = Pt(10)
run.font.color.rgb = RGBColor(0x66, 0x66, 0x66)
if i < len(items) - 1:
p.add_run().add_break()
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def insert_multiple_images_at_placeholder(doc: Document, placeholder: str, image_paths: list, width_inches: float = 2.80) -> bool:
if not image_paths:
return False
def replace_in_paragraph(p) -> bool:
full_text = "".join(run.text for run in p.runs)
if placeholder not in full_text:
return False
for r in p.runs:
r.text = ""
for i, image_path in enumerate(image_paths):
if not image_path or not os.path.exists(image_path):
continue
try:
img_stream = image_to_png_stream(image_path)
except Exception as e:
raise ValueError(f"Não consegui abrir/convert a imagem:\n{image_path}\n\nDetalhes:\n{e}")
run = p.add_run()
run.add_picture(img_stream, width=Inches(width_inches))
is_last = i == len(image_paths) - 1
if not is_last:
if i % 2 == 0:
p.add_run(" ")
else:
p.add_run().add_break()
return True
for p in doc.paragraphs:
if replace_in_paragraph(p):
return True
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
if replace_in_paragraph(p):
return True
for section in doc.sections:
for p in section.header.paragraphs:
if replace_in_paragraph(p):
return True
for p in section.footer.paragraphs:
if replace_in_paragraph(p):
return True
return False
def fatal_popup_and_exit(title: str, msg: str, exit_code: int = 1):
win = tk.Tk()
win.title(title)
win.geometry("520x260")
win.resizable(False, False)
frm = ttk.Frame(win, padding=14)
frm.pack(fill="both", expand=True)
ttk.Label(frm, text=title, font=("Segoe UI", 12, "bold")).pack(anchor="w", pady=(0, 8))
txt = tk.Text(frm, height=8, wrap="word")
txt.pack(fill="both", expand=True)
txt.insert("1.0", msg)
txt.config(state="disabled")
def close_and_exit():
win.destroy()
raise SystemExit(exit_code)
ttk.Button(frm, text="OK", command=close_and_exit).pack(anchor="e", pady=(10, 0))
win.protocol("WM_DELETE_WINDOW", close_and_exit)
win.mainloop()
def info_popup(title: str, msg: str):
win = tk.Toplevel()
win.title(title)
win.geometry("520x240")
win.resizable(False, False)
frm = ttk.Frame(win, padding=14)
frm.pack(fill="both", expand=True)
ttk.Label(frm, text=title, font=("Segoe UI", 12, "bold")).pack(anchor="w", pady=(0, 8))
txt = tk.Text(frm, height=7, wrap="word")
txt.pack(fill="both", expand=True)
txt.insert("1.0", msg)
txt.config(state="disabled")
def close():
win.destroy()
ttk.Button(frm, text="OK", command=close).pack(anchor="e", pady=(10, 0))
win.grab_set()
win.focus_force()
def replace_placeholders_in_doc(doc: Document, mapping: dict) -> None:
for p in doc.paragraphs:
text = p.text
new_text = text
for k, v in mapping.items():
new_text = new_text.replace(k, v)
if new_text != text:
p.text = new_text
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for p in cell.paragraphs:
text = p.text
new_text = text
for k, v in mapping.items():
new_text = new_text.replace(k, v)
if new_text != text:
p.text = new_text
def generate_output_filename() -> str:
stamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
return f"{stamp}.docx"
def build_presence_text(values: dict) -> str:
parts = []
present_people = []
presencas = values.get("presencas") or []
if not presencas:
if values.get("segurado_presente"):
presencas.append(
{
"tipo": "segurado",
"nome": values.get("segurado_nome"),
"info": values.get("segurado_info"),
}
)
if values.get("lesado_presente"):
presencas.append(
{
"tipo": "lesado",
"nome": values.get("lesado_nome"),
"info": values.get("lesado_info"),
}
)
if values.get("outro_presente"):
presencas.append(
{
"tipo": "outro",
"nome": values.get("outro_nome"),
"info": values.get("outro_info"),
}
)
def join_people(items: list) -> str:
if not items:
return ""
if len(items) == 1:
return items[0]
return ", ".join(items[:-1]) + " e " + items[-1]
for item in presencas:
tipo = (item.get("tipo") or "").strip().lower()
nome = (item.get("nome") or "").strip()
info = (item.get("info") or "").strip()
if not nome:
continue
if tipo == "segurado":
present_people.append(f"o segurado, {nome}")
if info:
parts.append(f"O segurado, {nome} informou que {info}.")
elif tipo == "lesado":
present_people.append(f"o lesado, {nome}")
if info:
parts.append(f"O lesado, {nome} informou que {info}.")
else:
present_people.append(nome)
if info:
parts.append(f"{nome} informou que {info}.")
header = ""
if present_people:
joined = join_people(present_people)
if len(present_people) == 1:
header = f"{joined} esteve presente aquando a pesquisa."
else:
header = f"{joined} estiveram presentes aquando a pesquisa."
if header and parts:
return header + "\n\n" + "\n".join(parts)
if header:
return header
if parts:
return "\n".join(parts)
return ""
def run_generation(values: dict, root: tk.Tk):
mapping = {
"{{nproc}}": (values.get("nproc") or "").strip(),
"{{segurado}}": (values.get("segurado") or "").strip(),
"{{comp}}": (values.get("comp") or "").strip(),
"{{terceiro}}": (values.get("terceiro") or "").strip(),
"{{data}}": (values.get("data") or "").strip(),
"{{local da visita}}": (values.get("local") or "").strip(),
"{{descriçãoimovel}}": (values.get("descriçãoimovel") or "").strip(),
"{{anoconstr}}": (values.get("anoconstr") or "").strip(),
"{{presencas}}": build_presence_text(values),
"{{descricao}}": (values.get("descricao") or "").strip(),
"{{area}}": (values.get("area") or "").strip(),
}
template_path = resource_path(TEMPLATE_DOCX)
if not os.path.exists(template_path):
try:
root.destroy()
except Exception:
pass
fatal_popup_and_exit(
"Erro: template não encontrado",
f"Não encontrei o template '{TEMPLATE_DOCX}'.\n\n"
f"Coloca o ficheiro '{TEMPLATE_DOCX}' na mesma pasta do executável e volta a executar."
)
return
output_docx = generate_output_filename()
try:
doc = Document(template_path)
replace_placeholders_in_doc(doc, mapping)
foto1_path = (values.get("foto1_path") or "").strip()
fotos2_paths = values.get("fotos2_paths") or []
placeholders = {
"{{foto1}}": foto1_path,
}
missing = insert_images_at_placeholders(doc, placeholders, width_inches=6.20)
if missing:
info_popup(
"Aviso",
"Não encontrei os placeholders no template (corpo/cabeçalho/rodapé):\n"
+ ", ".join(missing)
)
if fotos2_paths:
ok_multi = insert_multiple_images_at_placeholder(doc, "{{foto2}}", fotos2_paths, width_inches=2.80)
if not ok_multi:
info_popup(
"Aviso",
"Não encontrei o placeholder {{foto2}} no template (corpo/cabeçalho/rodapé)."
)
tecnicas = values.get("tecnicas") or []
if tecnicas:
ok_tecnicas = insert_tecnicas_utilizadas(doc, "{{tecnicasutilizadas}}", tecnicas)
if not ok_tecnicas:
info_popup(
"Aviso",
"Não encontrei o placeholder {{tecnicasutilizadas}} no template (corpo/cabeçalho/rodapé)."
)
inicio_pesquisa = values.get("inicio_pesquisa") or []
if inicio_pesquisa:
ok_inicio = insert_tecnicas_utilizadas(doc, "{{iniciopesquisa}}", inicio_pesquisa)
if not ok_inicio:
info_popup(
"Aviso",
"Não encontrei o placeholder {{iniciopesquisa}} no template (corpo/cabeçalho/rodapé)."
)
if values.get("inicio_pesquisa") or values.get("tecnicas"):
ok_metodos = insert_metodos_utilizados(doc, "{{metodosutilizados}}", values)
if not ok_metodos:
info_popup(
"Aviso",
"Não encontrei o placeholder {{metodosutilizados}} no template (corpo/cabeçalho/rodapé)."
)
doc.save(output_docx)
info_popup("Sucesso", f"Documento gerado com sucesso:\n\n{output_docx}")
except Exception as e:
try:
root.destroy()
except Exception:
pass
fatal_popup_and_exit(
"Erro ao gerar documento",
f"Falhou ao gerar o documento.\n\nDetalhes:\n{e}"
)
def choose_image(foto_var):
path = filedialog.askopenfilename(
title="Selecionar fotografia",
filetypes=[
("Imagens", "*.png *.jpg *.jpeg *.bmp"),
("Todos os ficheiros", "*.*"),
],
)
if path:
foto_var.set(path)
def choose_images(fotos_var, label_var):
paths = filedialog.askopenfilenames(
title="Selecionar fotografias",
filetypes=[
("Imagens", "*.png *.jpg *.jpeg *.bmp"),
("Todos os ficheiros", "*.*"),
],
)
if paths:
fotos_var.set(list(paths))
label_var.set(f"{len(paths)} imagem(ns)")
def main():
root = tk.Tk()
root.title("Preencher Corpus (Word)")
root.geometry("1120x640")
root.resizable(False, False)
frm = ttk.Frame(root, padding=16)
frm.pack(fill="both", expand=True)
fields = [("Nº do Processo:", "nproc"),("Segurado:", "segurado"),
("Companhia:", "comp"),
("Terceiro:", "terceiro"),
("Data da visita:", "data"),
("Local da visita:", "local"),
("Descrição do imóvel:", "descriçãoimovel"),
("Ano de Construção:", "anoconstr"),
("Descrição da pesquisa:", "descricao"),
("Área do do espaço:", "area")
]
entries = {}
foto_var = tk.StringVar(value="")
fotos2_var = tk.Variable(value=[])
fotos2_label = tk.StringVar(value="")
tecnicas_data = []
inicio_data = []
for i, (label, key) in enumerate(fields):
ttk.Label(frm, text=label).grid(row=i, column=0, sticky="w", pady=6)
ent = ttk.Entry(frm, width=80)
ent.grid(row=i, column=1, sticky="w", pady=6)
entries[key] = ent
if key == "descriçãoimovel":
ttk.Button(
frm,
text="Escolher imagem…",
command=lambda: choose_image(foto_var)
).grid(row=i, column=2, sticky="w", padx=8)
ttk.Label(
frm,
textvariable=foto_var,
width=28
).grid(row=i, column=4, sticky="w")
if key == "descricao":
ttk.Button(
frm,
text="Escolher imagens…",
command=lambda: choose_images(fotos2_var, fotos2_label)
).grid(row=i, column=2, sticky="w", padx=8)
ttk.Label(
frm,
textvariable=fotos2_label,
width=14
).grid(row=i, column=4, sticky="w")
def build_tecnicas_window(title: str, data_list: list):
win = tk.Toplevel(root)
win.title(title)
win.geometry("980x520")
win.resizable(False, False)
container = ttk.Frame(win, padding=16)
container.pack(fill="both", expand=True)
if not data_list:
tecnicas_list = [
"Controlo Visual",
"Medição de humidade",
"Câmara térmica",
"Câmara endoscópica",
"Obturação",
"Teste de pressão",
"Teste com corantes",
]
for nome in tecnicas_list:
data_list.append({
"name": nome,
"var": tk.BooleanVar(value=False),
"desc": tk.StringVar(value=""),
"photos": tk.Variable(value=[]),
"label": tk.StringVar(value=""),
})
def set_row_state(row_widgets, enabled: bool):
state = "normal" if enabled else "disabled"
for w in row_widgets:
w.configure(state=state)
for idx, item in enumerate(data_list):
row = ttk.Frame(container)
row.pack(fill="x", pady=6)
chk = ttk.Checkbutton(
row,
text=item["name"],
variable=item["var"],
command=lambda it=item: set_row_state(it["widgets"], it["var"].get())
)
chk.grid(row=0, column=0, sticky="w")
ttk.Label(row, text="Descrição:").grid(row=0, column=1, sticky="w", padx=(12, 4))
entry = ttk.Entry(row, textvariable=item["desc"], width=50)
entry.grid(row=0, column=2, sticky="w")
btn = ttk.Button(
row,
text="Escolher fotos…",
command=lambda it=item: choose_images(it["photos"], it["label"])
)
btn.grid(row=0, column=3, sticky="w", padx=10)
lbl = ttk.Label(row, textvariable=item["label"], width=18)
lbl.grid(row=0, column=4, sticky="w")
item["widgets"] = [entry, btn]
set_row_state(item["widgets"], item["var"].get())
ttk.Button(container, text="Fechar", command=win.destroy).pack(anchor="e", pady=(12, 0))
win.grab_set()
win.focus_force()
ttk.Button(
frm,
text="Técnicas utilizadas…",
command=lambda: build_tecnicas_window("Técnicas utilizadas", tecnicas_data)
).grid(row=len(fields), column=0, sticky="w", pady=(14, 0))
ttk.Button(
frm,
text="Início da pesquisa…",
command=lambda: build_tecnicas_window("Início da pesquisa", inicio_data)
).grid(row=len(fields), column=1, sticky="w", pady=(14, 0), padx=(12, 0))
presence_frame = ttk.LabelFrame(frm, text="Presencas na pesquisa", padding=12)
presence_frame.grid(row=len(fields) + 1, column=0, columnspan=4, sticky="w", pady=(12, 6))
presenca_rows = {
"segurado": [],
"lesado": [],
"outro": [],
}
type_frames = {}
type_labels = {
"segurado": "segurado",
"lesado": "lesado",
"outro": "outro",
}
def remove_presence_row(tipo: str, row_data: dict):
row_data["frame"].destroy()
presenca_rows[tipo] = [r for r in presenca_rows[tipo] if r is not row_data]
def add_presence_row(tipo: str):
container = type_frames[tipo]
row = ttk.Frame(container)
row.pack(fill="x", pady=3)
nome_var = tk.StringVar(value="")
info_var = tk.StringVar(value="")
ttk.Label(row, text=f"Nome do {type_labels[tipo]}:").grid(row=0, column=0, sticky="w")
ttk.Entry(row, textvariable=nome_var, width=30).grid(row=0, column=1, sticky="w", padx=6)
ttk.Label(row, text="Declaracoes:").grid(row=0, column=2, sticky="w", padx=(12, 0))
ttk.Entry(row, textvariable=info_var, width=42).grid(row=0, column=3, sticky="w", padx=6)
row_data = {
"frame": row,
"nome": nome_var,
"info": info_var,
}
ttk.Button(
row,
text="Remover",
command=lambda t=tipo, d=row_data: remove_presence_row(t, d)
).grid(row=0, column=4, sticky="w", padx=(8, 0))
presenca_rows[tipo].append(row_data)
def build_presence_section(parent, row_index: int, tipo: str, titulo: str):
sec = ttk.Frame(parent)
sec.grid(row=row_index, column=0, sticky="w", pady=4)
ttk.Label(sec, text=titulo).grid(row=0, column=0, sticky="w")
ttk.Button(
sec,
text=f"Adicionar {type_labels[tipo]}",
command=lambda t=tipo: add_presence_row(t)
).grid(row=0, column=1, sticky="w", padx=(10, 0))
container = ttk.Frame(sec)
container.grid(row=1, column=0, columnspan=2, sticky="w", pady=(6, 0))
type_frames[tipo] = container
build_presence_section(presence_frame, 0, "segurado", "Segurados")
build_presence_section(presence_frame, 1, "lesado", "Lesados")
build_presence_section(presence_frame, 2, "outro", "Outros")
add_presence_row("segurado")
def on_generate():
values = {k: e.get() for k, e in entries.items()}
values["foto1_path"] = foto_var.get()
values["fotos2_paths"] = list(fotos2_var.get()) if fotos2_var.get() else []
values["tecnicas"] = [
{
"name": t["name"],
"selected": t["var"].get(),
"desc": t["desc"].get(),
"photos": list(t["photos"].get()) if t["photos"].get() else [],
}
for t in tecnicas_data
]
values["inicio_pesquisa"] = [
{
"name": t["name"],
"selected": t["var"].get(),
"desc": t["desc"].get(),
"photos": list(t["photos"].get()) if t["photos"].get() else [],
}
for t in inicio_data
]
values["presencas"] = []
for tipo in ("segurado", "lesado", "outro"):
for row in presenca_rows[tipo]:
values["presencas"].append(
{
"tipo": tipo,
"nome": row["nome"].get(),
"info": row["info"].get(),
}
)
run_generation(values, root)
btns = ttk.Frame(frm)
btns.grid(row=len(fields) + 2, column=0, columnspan=2, sticky="w", pady=(18, 0))
ttk.Button(btns, text="Gerar Word", command=on_generate).pack(side="left")
ttk.Button(btns, text="Sair", command=root.destroy).pack(side="left", padx=10)
root.mainloop()
if __name__ == "__main__":
main()