componentsDjangoType 2.1.3__tar.gz → 2.1.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. {componentsdjangotype-2.1.3/componentsDjangoType.egg-info → componentsdjangotype-2.1.4}/PKG-INFO +1 -1
  2. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  3. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/authenticator_configurator.py +4 -6
  4. componentsdjangotype-2.1.4/services/copy_source.py +36 -0
  5. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/setup.py +1 -1
  6. componentsdjangotype-2.1.3/services/copy_source.py +0 -31
  7. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/LICENSE +0 -0
  8. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/MANIFEST.in +0 -0
  9. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/README.md +0 -0
  10. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/__init__.py +0 -0
  11. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
  12. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/management/__init__.py +0 -0
  13. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
  14. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/__init__.py +0 -0
  15. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
  16. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
  17. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/createApp.py +0 -0
  18. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  19. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  20. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  21. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/requires.txt +0 -0
  22. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/top_level.txt +0 -0
  23. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/__init__.py +0 -0
  24. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/authentication/__init__.py +0 -0
  25. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/authentication/auth.py +0 -0
  26. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/authentication/forms.py +0 -0
  27. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/utils/css/authentication.css +0 -0
  28. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/utils/js/alertErrors.js +0 -0
  29. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/utils/views/home.html +0 -0
  30. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/utils/views/layouts/index.html +0 -0
  31. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/utils/views/logged.html +0 -0
  32. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/utils/views/login.html +0 -0
  33. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/services/utils/views/signup.html +0 -0
  34. {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.1.3
3
+ Version: 2.1.4
4
4
  Summary: Comandos para crear archivos html, css y js
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.1.3
3
+ Version: 2.1.4
4
4
  Summary: Comandos para crear archivos html, css y js
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -259,14 +259,12 @@ urlpatterns = [
259
259
  files_to_copy = [
260
260
  ("services.utils.js", "alertErrors.js", os.path.join(js_dir, "alertErrors.js")),
261
261
  ("services.utils.css", "authentication.css", os.path.join(css_dir, "authentication.css")),
262
- ("services.utils.css", "user/aside.css", os.path.join(user_dir_css, "aside.css")), # Corrige aquí
262
+ ("services.utils.css.user", "", user_dir_css), # Copiar todo el contenido del directorio 'css/user'
263
263
  ("services.utils.views.layouts", "index.html", os.path.join(layouts_dir, "index.html")),
264
264
  ("services.utils.views", "home.html", os.path.join(templates_dir, "home.html")),
265
- ("services.utils.views", "signup.html", os.path.join(templates_dir, "signup.html")),
266
- ("services.utils.views", "login.html", os.path.join(templates_dir, "login.html")),
267
- ("services.utils.views", "logged.html", os.path.join(templates_dir, "logged.html")),
268
- ("services.utils.views", "user/user.html", os.path.join(user_dir_html, "user.html")), # Corrige aquí
269
- ("services.utils.views", "components/aside.html", os.path.join(user_dir_components, "aside.html")), # Corrige aquí
265
+ ("services.utils.views", "", templates_dir), # Copiar todos los templates
266
+ ("services.utils.views.user", "", user_dir_html), # Copiar todo el contenido de 'views/user'
267
+ ("services.utils.views.components", "", user_dir_components), # Copiar todos los componentes
270
268
  ]
271
269
 
272
270
  for package, resource_name, destination_path in files_to_copy:
@@ -0,0 +1,36 @@
1
+ import importlib.resources as pkg_resources
2
+ import shutil
3
+ import os
4
+ import sys
5
+
6
+ def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout):
7
+ """
8
+ Copia un archivo estático empaquetado a una ruta de destino.
9
+
10
+ :param package: El nombre del paquete donde está el recurso.
11
+ :param resource_name: Ruta relativa del recurso dentro del paquete (puede ser un archivo o un directorio).
12
+ :param destination_path: Ruta completa donde se copiará el archivo o estructura.
13
+ :param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
14
+ """
15
+ try:
16
+ # Si el recurso es un directorio, recorre sus contenidos
17
+ if pkg_resources.is_resource(package, resource_name) or not resource_name:
18
+ os.makedirs(destination_path, exist_ok=True) # Asegura que el directorio exista
19
+ for resource in pkg_resources.contents(package):
20
+ resource_path = os.path.join(resource_name, resource) if resource_name else resource
21
+ dest_path = os.path.join(destination_path, resource)
22
+ copy_static_file(package, resource_path, dest_path, stdout)
23
+ else:
24
+ # Es un archivo; cópialo directamente
25
+ if not pkg_resources.is_resource(package, resource_name):
26
+ stdout.write(f"El recurso '{resource_name}' no existe en el paquete '{package}'.\n")
27
+ return
28
+
29
+ os.makedirs(os.path.dirname(destination_path), exist_ok=True) # Asegura el directorio
30
+ with pkg_resources.open_binary(package, resource_name) as resource_file:
31
+ with open(destination_path, 'wb') as dest_file:
32
+ shutil.copyfileobj(resource_file, dest_file)
33
+
34
+ stdout.write(f"El recurso '{resource_name}' fue copiado a '{destination_path}'.\n")
35
+ except Exception as e:
36
+ stdout.write(f"Error al copiar el recurso '{resource_name}' desde '{package}': {e}\n")
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='2.1.3',
5
+ version='2.1.4',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  package_data={
@@ -1,31 +0,0 @@
1
- import importlib.resources as pkg_resources
2
- import shutil
3
- import os
4
- import sys
5
-
6
- def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout):
7
- """
8
- Copia un archivo estático empaquetado a una ruta de destino.
9
-
10
- :param package: El nombre del paquete donde está el recurso.
11
- :param resource_name: Ruta relativa del recurso dentro del paquete.
12
- :param destination_path: Ruta completa donde se copiará el archivo.
13
- :param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
14
- """
15
- try:
16
- # Verifica si el recurso existe en el paquete
17
- if not pkg_resources.is_resource(package, resource_name):
18
- stdout.write(f"El recurso '{resource_name}' no existe en el paquete '{package}'.\n")
19
- return
20
-
21
- # Crear el directorio de destino si no existe
22
- os.makedirs(os.path.dirname(destination_path), exist_ok=True)
23
-
24
- # Leer el archivo desde el paquete y escribirlo en la ruta destino
25
- with pkg_resources.open_binary(package, resource_name) as resource_file:
26
- with open(destination_path, 'wb') as dest_file:
27
- shutil.copyfileobj(resource_file, dest_file)
28
-
29
- stdout.write(f"El recurso '{resource_name}' fue copiado a '{destination_path}'.\n")
30
- except Exception as e:
31
- stdout.write(f"Error al copiar el archivo: {e}\n")