componentsDjangoType 2.0.9__tar.gz → 2.0.11__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (20) hide show
  1. {componentsdjangotype-2.0.9/componentsDjangoType.egg-info → componentsdjangotype-2.0.11}/PKG-INFO +1 -3
  2. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType/management/commands/createApp.py +2 -3
  3. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11/componentsDjangoType.egg-info}/PKG-INFO +1 -3
  4. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/services/authenticator_configurator.py +11 -11
  5. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/setup.py +1 -3
  6. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/LICENSE +0 -0
  7. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/MANIFEST.in +0 -0
  8. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/README.md +0 -0
  9. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType/__init__.py +0 -0
  10. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType/management/__init__.py +0 -0
  11. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType/management/commands/__init__.py +0 -0
  12. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  13. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  14. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  15. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType.egg-info/requires.txt +0 -0
  16. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/componentsDjangoType.egg-info/top_level.txt +0 -0
  17. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/services/__init__.py +0 -0
  18. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/services/authentication/__init__.py +0 -0
  19. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/services/authentication/auth.py +0 -0
  20. {componentsdjangotype-2.0.9 → componentsdjangotype-2.0.11}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.0.9
3
+ Version: 2.0.11
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
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.7
17
15
  Classifier: Framework :: Django :: 3.2
18
16
  Description-Content-Type: text/markdown
19
17
  License-File: LICENSE
@@ -1,6 +1,5 @@
1
1
  import os
2
2
  from django.core.management.base import BaseCommand
3
- from django.core.management import call_command
4
3
  from services.authenticator_configurator import DjangoProjectManager
5
4
 
6
5
  class Command(BaseCommand):
@@ -32,10 +31,10 @@ class Command(BaseCommand):
32
31
  creation.installed_app()
33
32
 
34
33
  # Paso 3: Crear el archivo urls.py en la aplicación "Home" si no existe
35
- creation.create_urls()
34
+ creation.create_urls(self.stdout)
36
35
 
37
36
  # Paso 4: Crear la carpeta services y el archivo authentication.py en Home
38
- creation.creation_auth()
37
+ creation.creation_auth(self.stdout)
39
38
 
40
39
  home_dir = "Home"
41
40
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.0.9
3
+ Version: 2.0.11
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
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.7
17
15
  Classifier: Framework :: Django :: 3.2
18
16
  Description-Content-Type: text/markdown
19
17
  License-File: LICENSE
@@ -3,7 +3,7 @@ import ast
3
3
  from django.core.management.base import BaseCommand
4
4
  from django.core.management import call_command
5
5
 
6
- class DjangoProjectManager(BaseCommand):
6
+ class DjangoProjectManager:
7
7
  def __init__(self, app_name, project_name):
8
8
  self.app_name = app_name
9
9
  self.project_name = project_name
@@ -46,7 +46,7 @@ class DjangoProjectManager(BaseCommand):
46
46
  # Comprobar si la aplicación no está ya en INSTALLED_APPS
47
47
  if f"'{self.app_name}'" not in installed_apps_content:
48
48
  # Insertar la aplicación dentro de la lista
49
- new_installed_apps = installed_apps_content[:-1] + f"\n'{self.app_name}',\n]"
49
+ new_installed_apps = installed_apps_content[:-1] + f"'{self.app_name}',\n]"
50
50
 
51
51
  # Reemplazar el bloque INSTALLED_APPS con la nueva lista
52
52
  new_settings_content = settings_content[:installed_apps_start] + new_installed_apps + settings_content[installed_apps_end:]
@@ -61,7 +61,7 @@ class DjangoProjectManager(BaseCommand):
61
61
  else:
62
62
  print(f"'{self.app_name}' ya está en INSTALLED_APPS.")
63
63
 
64
- def create_urls(self):
64
+ def create_urls(self, stdout):
65
65
  """
66
66
  Crea el archivo 'urls.py' si no existe, y si existe, agrega nuevas rutas
67
67
  sin sobrescribir el contenido existente.
@@ -70,7 +70,7 @@ class DjangoProjectManager(BaseCommand):
70
70
 
71
71
  if not os.path.exists(urls_path):
72
72
  # Si el archivo no existe, lo creamos con un contenido básico
73
- self.stdout.write(f"Creando el archivo '{urls_path}'...")
73
+ stdout.write(f"Creando el archivo '{urls_path}'...")
74
74
  with open(urls_path, 'w') as f:
75
75
  f.write("""from django.contrib import admin
76
76
  from django.urls import path, include\n\n
@@ -82,7 +82,7 @@ urlpatterns = [
82
82
  ]\n""")
83
83
  else:
84
84
  # Si el archivo ya existe, lo leemos y agregamos nuevas rutas
85
- self.stdout.write(f"El archivo '{urls_path}' ya existe. Agregando nuevas rutas...")
85
+ stdout.write(f"El archivo '{urls_path}' ya existe. Agregando nuevas rutas...")
86
86
 
87
87
  with open(urls_path, 'r') as f:
88
88
  urls_content = f.read()
@@ -111,11 +111,11 @@ urlpatterns = [
111
111
  # Escribir el contenido actualizado en el archivo
112
112
  with open(urls_path, 'w') as f:
113
113
  f.write(urls_content)
114
- self.stdout.write(f"Nuevas rutas fueron agregadas a '{urls_path}'.")
114
+ stdout.write(f"Nuevas rutas fueron agregadas a '{urls_path}'.")
115
115
  else:
116
- self.stdout.write(f"No se encontró la lista 'urlpatterns' en '{urls_path}'.")
116
+ stdout.write(f"No se encontró la lista 'urlpatterns' en '{urls_path}'.")
117
117
 
118
- def creation_auth(self):
118
+ def creation_auth(self, stdout):
119
119
  services_dir = os.path.join(self.app_name, 'services')
120
120
  authentication_dir = os.path.join(services_dir, 'authentication')
121
121
  os.makedirs(authentication_dir, exist_ok=True)
@@ -123,7 +123,7 @@ urlpatterns = [
123
123
  authentication_path = os.path.join(authentication_dir, 'auth.py')
124
124
 
125
125
  if not os.path.exists(authentication_path):
126
- self.stdout.write(f"Creando el archivo '{authentication_path}'...")
126
+ stdout.write(f"Creando el archivo '{authentication_path}'...")
127
127
 
128
128
  auth_path = os.path.join(self.app_name, 'services', 'authentication', 'auth.py')
129
129
 
@@ -135,9 +135,9 @@ urlpatterns = [
135
135
  with open(authentication_path, 'w') as file:
136
136
  file.write(auth_code)
137
137
 
138
- self.stdout.write(f"El archivo '{authentication_path}' fue creado y el código fue escrito.")
138
+ stdout.write(f"El archivo '{authentication_path}' fue creado y el código fue escrito.")
139
139
  else:
140
- self.stdout.write(f"El archivo '{authentication_path}' ya existe.")
140
+ stdout.write(f"El archivo '{authentication_path}' ya existe.")
141
141
 
142
142
 
143
143
 
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='2.0.9',
5
+ version='2.0.11',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',
@@ -19,8 +19,6 @@ setup(
19
19
  'License :: OSI Approved :: MIT License',
20
20
  'Operating System :: OS Independent',
21
21
  'Programming Language :: Python',
22
- 'Programming Language :: Python :: 3',
23
- 'Programming Language :: Python :: 3.7',
24
22
  'Framework :: Django :: 3.2',
25
23
  ],
26
24
  install_requires=[