componentsDjangoType 2.1.6__tar.gz → 2.1.12__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.6/componentsDjangoType.egg-info → componentsdjangotype-2.1.12}/PKG-INFO +1 -1
  2. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  3. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/authenticator_configurator.py +14 -41
  4. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/copy_source.py +7 -10
  5. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/views/layouts/index.html +4 -7
  6. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/views/login.html +0 -4
  7. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/views/signup.html +1 -8
  8. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/setup.py +1 -1
  9. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/LICENSE +0 -0
  10. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/MANIFEST.in +0 -0
  11. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/README.md +0 -0
  12. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/__init__.py +0 -0
  13. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
  14. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/management/__init__.py +0 -0
  15. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
  16. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/__init__.py +0 -0
  17. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
  18. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
  19. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/createApp.py +0 -0
  20. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  21. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  22. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  23. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/requires.txt +0 -0
  24. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/top_level.txt +0 -0
  25. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/__init__.py +0 -0
  26. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/authentication/__init__.py +0 -0
  27. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/authentication/auth.py +0 -0
  28. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/authentication/forms.py +0 -0
  29. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/__init__.py +0 -0
  30. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/css/authentication.css +0 -0
  31. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/js/alertErrors.js +0 -0
  32. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/views/home.html +0 -0
  33. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/services/utils/views/logged.html +0 -0
  34. {componentsdjangotype-2.1.6 → componentsdjangotype-2.1.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.1.6
3
+ Version: 2.1.12
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.6
3
+ Version: 2.1.12
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
@@ -2,7 +2,6 @@ import os
2
2
  from django.core.management import call_command
3
3
  from services.authentication import auth, forms
4
4
  from services.copy_source import copy_static_file
5
- import importlib.resources as pkg_resources
6
5
 
7
6
  class DjangoProjectManager:
8
7
  def __init__(self, app_name, project_name):
@@ -135,41 +134,38 @@ urlpatterns = [
135
134
 
136
135
  # Ruta para el nuevo archivo a crear
137
136
  authentication_path = os.path.join(authentication_dir, 'auth.py')
138
- form_path = os.path.join(authentication_dir, 'form.py')
137
+ forms_path = os.path.join(authentication_dir, 'forms.py')
139
138
 
140
139
  # Usar el atributo __file__ del módulo 'auth' para obtener la ruta del archivo fuente
141
140
  auth_source_path = os.path.abspath(auth.__file__)
142
- form_source_path = os.path.abspath(forms.__file__)
141
+ forms_source_path = os.path.abspath(auth.__file__)
143
142
 
144
143
  if not os.path.exists(auth_source_path):
145
144
  stdout.write(f"El archivo fuente '{auth_source_path}' no existe. Verifica la instalación del paquete.")
146
- return
147
-
148
- if not os.path.exists(form_source_path):
149
- stdout.write(f"El archivo fuente '{form_source_path}' no existe. Verifica la instalación del paquete.")
145
+ stdout.write(f"El archivo fuente '{forms_source_path}' no existe. Verifica la instalación del paquete.")
150
146
  return
151
147
 
152
148
  if not os.path.exists(authentication_path):
153
149
  stdout.write(f"Creando el archivo '{authentication_path}'...")
154
- stdout.write(f"Creando el archivo '{form_path}'...")
150
+ stdout.write(f"Creando el archivo '{forms_path}'...")
155
151
 
156
152
  # Leer el contenido de 'auth.py' del paquete
157
153
  try:
158
154
  with open(auth_source_path, 'r') as source_file:
159
155
  auth_code = source_file.read()
160
156
 
161
- with open(form_source_path, 'r') as source_file:
162
- form_code = source_file.read
157
+ with open(forms_source_path, 'r') as source_file:
158
+ forms_code = source_file.read()
163
159
 
164
160
  # Escribir el contenido en el nuevo archivo 'authentication.py'
165
161
  with open(authentication_path, 'w') as dest_file:
166
162
  dest_file.write(auth_code)
167
-
168
- with open(form_path, 'w') as dest_file:
169
- dest_file.write(form_code)
163
+
164
+ with open(forms_path, 'w') as dest_file:
165
+ dest_file.write(forms_code)
170
166
 
171
167
  stdout.write(f"El archivo '{authentication_path}' fue creado y el código fue copiado.")
172
- stdout.write(f"El archivo '{form_path}' fue creado y el código fue copiado.")
168
+ stdout.write(f"El archivo '{forms_path}' fue creado y el código fue copiado.")
173
169
  except Exception as e:
174
170
  stdout.write(f"Error al copiar el archivo: {e}")
175
171
  else:
@@ -237,54 +233,31 @@ urlpatterns = [
237
233
  templates_dir = os.path.join(app_name, 'templates')
238
234
  static_dir = os.path.join(app_name, 'static')
239
235
 
240
- #creacion de subcarpetas
236
+ #creacin de subcarpetas
241
237
  layouts_dir = os.path.join(templates_dir, 'layouts')
242
238
  js_dir = os.path.join(static_dir, 'js')
243
239
  css_dir = os.path.join(static_dir, 'css')
244
- user_dir_css = os.path.join(css_dir, 'user')
245
- user_dir_html = os.path.join(templates_dir, 'user')
246
- user_dir_components = os.path.join(templates_dir, 'components')
247
240
 
248
241
  # Crear las carpetas principales y subcarpetas
249
242
  os.makedirs(templates_dir, exist_ok=True)
250
243
  os.makedirs(layouts_dir, exist_ok=True)
251
244
  os.makedirs(static_dir, exist_ok=True)
252
245
  os.makedirs(js_dir, exist_ok=True)
253
- os.makedirs(css_dir, exist_ok=True)
254
- os.makedirs(user_dir_css, exist_ok=True)
255
- os.makedirs(user_dir_html, exist_ok=True)
256
- os.makedirs(user_dir_components, exist_ok=True)
246
+ os.makedirs(css_dir, exist_ok=True)
257
247
 
258
248
  stdout.write("Estructura de carpetas creada.\n")
259
249
 
260
250
  files_to_copy = [
261
251
  ("services.utils.js", "alertErrors.js", os.path.join(js_dir, "alertErrors.js")),
262
252
  ("services.utils.css", "authentication.css", os.path.join(css_dir, "authentication.css")),
263
- ("services.utils.css.user", "aside.css", os.path.join(user_dir_css, "aside.css")), # Subpaquete específico
264
253
  ("services.utils.views.layouts", "index.html", os.path.join(layouts_dir, "index.html")),
265
254
  ("services.utils.views", "home.html", os.path.join(templates_dir, "home.html")),
266
255
  ("services.utils.views", "signup.html", os.path.join(templates_dir, "signup.html")),
267
256
  ("services.utils.views", "login.html", os.path.join(templates_dir, "login.html")),
268
257
  ("services.utils.views", "logged.html", os.path.join(templates_dir, "logged.html")),
269
- ("services.utils.views.user", "user.html", os.path.join(user_dir_html, "user.html")), # Subpaquete específico
270
- ("services.utils.views.components", "aside.html", os.path.join(user_dir_components, "aside.html")), # Subpaquete específico
271
258
  ]
272
259
 
273
- packages_to_check = [
274
- "services.utils.css",
275
- "services.utils.css.user",
276
- "services.utils.views",
277
- "services.utils.views.user",
278
- "services.utils.views.components"
279
- ]
280
-
281
- for package in packages_to_check:
282
- try:
283
- resources = list(pkg_resources.contents(package))
284
- print(f"Recursos disponibles en '{package}': {resources}")
285
- except ImportError as e:
286
- print(f"Error al importar el paquete '{package}': {e}")
287
- except Exception as e:
288
- print(f"Error desconocido en el paquete '{package}': {e}")
260
+ for package, resource_name, destination_path in files_to_copy:
261
+ copy_static_file(package, resource_name, destination_path, stdout)
289
262
 
290
263
  stdout.write("Archivos estáticos copiados.\n")
@@ -8,27 +8,24 @@ def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout
8
8
  Copia un archivo estático empaquetado a una ruta de destino.
9
9
 
10
10
  :param package: El nombre del paquete donde está el recurso.
11
- :param resource_name: Nombre del archivo dentro del paquete.
11
+ :param resource_name: Ruta relativa del recurso dentro del paquete.
12
12
  :param destination_path: Ruta completa donde se copiará el archivo.
13
13
  :param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
14
14
  """
15
15
  try:
16
- # Crear el directorio de destino si no existe
17
- os.makedirs(os.path.dirname(destination_path), exist_ok=True)
18
-
19
- # Verificar que el recurso existe
16
+ # Verifica si el recurso existe en el paquete
20
17
  if not pkg_resources.is_resource(package, resource_name):
21
18
  stdout.write(f"El recurso '{resource_name}' no existe en el paquete '{package}'.\n")
22
19
  return
23
20
 
24
- # Leer el archivo y escribirlo en la ruta destino
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
25
  with pkg_resources.open_binary(package, resource_name) as resource_file:
26
26
  with open(destination_path, 'wb') as dest_file:
27
27
  shutil.copyfileobj(resource_file, dest_file)
28
28
 
29
29
  stdout.write(f"El recurso '{resource_name}' fue copiado a '{destination_path}'.\n")
30
- except ImportError as e:
31
- stdout.write(f"Error: No se pudo importar el paquete '{package}': {e}\n")
32
30
  except Exception as e:
33
- stdout.write(f"Error al copiar el archivo '{resource_name}': {e}\n")
34
-
31
+ stdout.write(f"Error al copiar el archivo: {e}\n")
@@ -5,10 +5,7 @@
5
5
  <meta charset="UTF-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <link rel="stylesheet" href="{% static 'css/authentication.css' %}">
8
- {% block css %}
9
- {% endblock %}
10
- <!-- boxicons -->
11
- <script src="https://unpkg.com/boxicons@2.1.4/dist/boxicons.js"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
12
9
  <title>django components</title>
13
10
  </head>
14
11
  <body class="bg-gray-100 text-gray-800">
@@ -16,7 +13,7 @@
16
13
  <nav class="navbar">
17
14
  <div class="logo">
18
15
  <a href="{% url 'home' %}">
19
- <box-icon name='home' flip='horizontal' size="md" color="#ffffff"></box-icon>
16
+ <i class="fa-solid fa-house"></i>
20
17
  </a>
21
18
  </div>
22
19
  <div class="menu-toggle">
@@ -37,7 +34,7 @@
37
34
  {% endblock %}
38
35
  </div>
39
36
 
40
- {% block script %}
41
- {% endblock %}
37
+
38
+ <script src="{% static 'js/alertErrors.js'%}"></script>
42
39
  </body>
43
40
  </html>
@@ -1,5 +1,4 @@
1
1
  {% extends "layouts/index.html" %}
2
- {% load static %}
3
2
  {% block layout %}
4
3
  {% if error %}
5
4
  <div class="alert" id="alert">
@@ -31,7 +30,4 @@
31
30
  </form>
32
31
  </div>
33
32
  </div>
34
- {% endblock %}
35
- {% block script %}
36
- <script src="{% static 'js/alertErrors.js'%}"></script>
37
33
  {% endblock %}
@@ -1,5 +1,4 @@
1
1
  {% extends "layouts/index.html" %}
2
- {% load static %}
3
2
  {% block layout %}
4
3
  {% if error %}
5
4
  <div class="alert" id="alert">
@@ -17,13 +16,10 @@
17
16
 
18
17
  <div class="form-wrapper">
19
18
  <div class="form-container">
20
- <form action="" method="post" class="form-control" enctype="multipart/form-data">
19
+ <form action="" method="post" class="form-control">
21
20
  {% csrf_token %}
22
21
  <h1>sing up</h1>
23
22
 
24
- <label for="img_url">Imagen de Perfil:</label>
25
- {{ form.image }}
26
-
27
23
  <label for="username">Usuario:</label>
28
24
  {{ form.username }}
29
25
 
@@ -37,7 +33,4 @@
37
33
  </form>
38
34
  </div>
39
35
  </div>
40
- {% endblock %}
41
- {% block script %}
42
- <script src="{% static 'js/alertErrors.js'%}"></script>
43
36
  {% endblock %}
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='2.1.6',
5
+ version='2.1.12',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  package_data={