componentsDjangoType 1.0.1__tar.gz → 1.0.3__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. {componentsdjangotype-1.0.1/componentsDjangoType.egg-info → componentsdjangotype-1.0.3}/PKG-INFO +1 -1
  2. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/createApp.py +21 -14
  3. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  4. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/setup.py +1 -1
  5. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/LICENSE +0 -0
  6. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/MANIFEST.in +0 -0
  7. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/README.md +0 -0
  8. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/__init__.py +0 -0
  9. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/__init__.py +0 -0
  10. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/__init__.py +0 -0
  11. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  12. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/utils/css/authentication.css +0 -0
  13. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/utils/js/alertErrors.js +0 -0
  14. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/utils/layouts/index.html +0 -0
  15. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/utils/pages/home.html +0 -0
  16. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/utils/pages/logged.html +0 -0
  17. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/utils/pages/login.html +0 -0
  18. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType/management/commands/utils/pages/singup.html +0 -0
  19. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  20. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  21. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType.egg-info/requires.txt +0 -0
  22. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/componentsDjangoType.egg-info/top_level.txt +0 -0
  23. {componentsdjangotype-1.0.1 → componentsdjangotype-1.0.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -1,7 +1,7 @@
1
- # componentsDjangoType/management/commands/createcomponentApp.py
2
1
  import os
3
2
  from django.core.management.base import BaseCommand
4
3
  from django.core.management import call_command
4
+ import componentsDjangoType.management.commands.utils as utils
5
5
 
6
6
 
7
7
  class Command(BaseCommand):
@@ -9,6 +9,7 @@ class Command(BaseCommand):
9
9
 
10
10
  def handle(self, *args, **kwargs):
11
11
  # Nombre de la aplicación a crear
12
+
12
13
  app_name = "Home"
13
14
 
14
15
  # Paso 1: Solicitar el nombre de la aplicación principal al usuario
@@ -37,7 +38,8 @@ class Command(BaseCommand):
37
38
  self.stdout.write(f"El archivo '{urls_path}' ya existe.")
38
39
 
39
40
  # Paso 4: Modificar el archivo urls.py principal del proyecto
40
- project_urls_path = os.path.join(project_name, 'urls.py')
41
+ project_urls_path = os.path.join(
42
+ project_name, 'urls.py')
41
43
  if os.path.exists(project_urls_path):
42
44
  with open(project_urls_path, 'r') as f:
43
45
  content = f.read()
@@ -152,8 +154,6 @@ class Command(BaseCommand):
152
154
  self.stdout.write(
153
155
  f"El archivo '{authentication_file_path}' ya existe.")
154
156
 
155
- import os
156
-
157
157
  # Paso 6: Crear la carpeta templates y los archivos HTML
158
158
  # Asumiendo que `project_name` ya está definido
159
159
  templates_dir = os.path.join(project_name, 'templates')
@@ -162,6 +162,9 @@ class Command(BaseCommand):
162
162
  css_dir = os.path.join(static_dir, 'css')
163
163
  js_dir = os.path.join(static_dir, 'js')
164
164
 
165
+ # Ruta base para `utils`
166
+ utils_base_path = os.path.dirname(utils.__file__)
167
+
165
168
  # Crear los directorios necesarios
166
169
  os.makedirs(js_dir, exist_ok=True)
167
170
  os.makedirs(css_dir, exist_ok=True)
@@ -169,28 +172,32 @@ class Command(BaseCommand):
169
172
  os.makedirs(templates_dir, exist_ok=True)
170
173
  os.makedirs(static_dir, exist_ok=True)
171
174
 
172
- # Rutas de los archivos fuente y destino
173
- css_source_path = os.path.join('utils', 'css', 'authentication.css')
174
- authentication_css = os.path.join(css_dir, 'authentication.css')
175
- js_source_path = os.path.join('utils', 'js', 'alertErrors.js')
176
- alertErrors_js = os.path.join(js_dir, 'alertErrors.js')
175
+ css_source_path = os.path.join(
176
+ utils_base_path, 'css', 'authentication.css')
177
+ js_source_path = os.path.join(utils_base_path, 'js', 'alertErrors.js')
178
+ index_page_source = os.path.join(
179
+ utils_base_path, 'layouts', 'index.html')
180
+ home_page = os.path.join(utils_base_path, 'pages', 'home.html')
181
+ signup_page = os.path.join(utils_base_path, 'pages', 'signup.html')
182
+ login_page = os.path.join(utils_base_path, 'pages', 'login.html')
183
+ logged_page = os.path.join(utils_base_path, 'pages', 'logged.html')
177
184
 
178
185
  # Crear archivos si no existen
179
- if not os.path.exists(authentication_css):
186
+ if not os.path.exists(css_source_path):
180
187
  try:
181
188
  with open(css_source_path, 'r') as source_file:
182
189
  css_content = source_file.read()
183
190
  with open(js_source_path, 'r') as source_file:
184
191
  js_content = source_file.read()
185
192
 
186
- with open(authentication_css, 'w') as f:
193
+ with open(css_source_path, 'w') as f:
187
194
  f.write(css_content)
188
- with open(alertErrors_js, 'w') as f:
195
+ with open(js_source_path, 'w') as f:
189
196
  f.write(js_content)
190
197
 
191
198
  print(f"Archivo CSS creado exitosamente en {
192
- authentication_css}")
193
- print(f"Archivo JS creado exitosamente en {alertErrors_js}")
199
+ js_source_path}")
200
+ print(f"Archivo JS creado exitosamente en {js_source_path}")
194
201
  except FileNotFoundError as e:
195
202
  print(f"Archivo fuente no encontrado: {e}")
196
203
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='1.0.1',
5
+ version='1.0.3',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',