componentsDjangoType 2.1.2__tar.gz → 2.1.4__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {componentsdjangotype-2.1.2/componentsDjangoType.egg-info → componentsdjangotype-2.1.4}/PKG-INFO +1 -1
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/authenticator_configurator.py +6 -8
- componentsdjangotype-2.1.4/services/copy_source.py +36 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/setup.py +1 -1
- componentsdjangotype-2.1.2/services/copy_source.py +0 -31
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/LICENSE +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/MANIFEST.in +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/README.md +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/createApp.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/__init__.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/authentication/__init__.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/authentication/auth.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/authentication/forms.py +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/css/authentication.css +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/js/alertErrors.js +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/views/home.html +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/views/layouts/index.html +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/views/logged.html +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/views/login.html +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/views/signup.html +0 -0
- {componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/setup.cfg +0 -0
{componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/authenticator_configurator.py
RENAMED
@@ -158,7 +158,7 @@ urlpatterns = [
|
|
158
158
|
auth_code = source_file.read()
|
159
159
|
|
160
160
|
with open(form_source_path, 'r') as source_file:
|
161
|
-
form_code = source_file.read
|
161
|
+
form_code = source_file.read
|
162
162
|
|
163
163
|
# Escribir el contenido en el nuevo archivo 'authentication.py'
|
164
164
|
with open(authentication_path, 'w') as dest_file:
|
@@ -236,7 +236,7 @@ urlpatterns = [
|
|
236
236
|
templates_dir = os.path.join(app_name, 'templates')
|
237
237
|
static_dir = os.path.join(app_name, 'static')
|
238
238
|
|
239
|
-
#
|
239
|
+
#creacion de subcarpetas
|
240
240
|
layouts_dir = os.path.join(templates_dir, 'layouts')
|
241
241
|
js_dir = os.path.join(static_dir, 'js')
|
242
242
|
css_dir = os.path.join(static_dir, 'css')
|
@@ -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", "
|
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", "
|
266
|
-
("services.utils.views", "
|
267
|
-
("services.utils.views", "
|
268
|
-
("services.utils.views.user", "user.html", os.path.join(user_dir_html, "user.html")),
|
269
|
-
("services.utils.views.components", "aside.html", os.path.join(user_dir_components, "aside.html")),
|
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")
|
@@ -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")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/componentsDjangoType.egg-info/requires.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/authentication/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/css/authentication.css
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.2 → componentsdjangotype-2.1.4}/services/utils/views/layouts/index.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|