componentsDjangoType 1.0.6__tar.gz → 1.0.8__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (16) hide show
  1. {componentsdjangotype-1.0.6/componentsDjangoType.egg-info → componentsdjangotype-1.0.8}/PKG-INFO +1 -1
  2. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/commands/createApp.py +96 -99
  3. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  4. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/setup.py +1 -1
  5. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/LICENSE +0 -0
  6. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/MANIFEST.in +0 -0
  7. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/README.md +0 -0
  8. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/__init__.py +0 -0
  9. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/__init__.py +0 -0
  10. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/commands/__init__.py +0 -0
  11. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  12. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  13. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  14. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/requires.txt +0 -0
  15. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/top_level.txt +0 -0
  16. {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -11,6 +11,15 @@ class Command(BaseCommand):
11
11
  # Nombre de la aplicación a crear
12
12
  app_name = "Home"
13
13
 
14
+ # definiendoerrores
15
+ def write_file(file_path, content):
16
+ try:
17
+ with open(file_path, 'w') as file:
18
+ file.write(content)
19
+ print(f"Archivo escrito correctamente: {file_path}")
20
+ except Exception as e:
21
+ print(f"Error al escribir el archivo {file_path}: {e}")
22
+
14
23
  # Paso 1: Solicitar el nombre de la aplicación principal al usuario
15
24
  project_name = input(
16
25
  "Por favor, ingresa el nombre de la aplicación principal del proyecto: ")
@@ -177,88 +186,88 @@ class Command(BaseCommand):
177
186
  layout_files_path = os.path.join(layouts_dir, 'index.html')
178
187
 
179
188
  template_files = {
180
- 'home.html': """{% extends "layouts/index.html" %}\n
181
- {% block layout %}
182
- {% endblock %}""",
189
+ 'home.html': """{% extends "layouts/index.html" %}
190
+ {% block layout %}
191
+ {% endblock %}""",
183
192
  'signup.html': """{% extends "layouts/index.html" %}
184
- {% block layout %}
185
- {% if error %}
186
- <div class="alert" id="alert">
187
- <div class="alert-content">
188
- {{ error }}
189
- <button class="close-btn" onclick="closeAlert()">
190
- <span class="sr-only">Close</span>
191
- <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
192
- <path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
193
- </svg>
194
- </button>
195
- </div>
196
- </div>
197
- {% endif %}\n
198
- <div class="form-wrapper">
199
- <div class="form-container">
200
- <form action="" method="post" class="form-control">
201
- {% csrf_token %}
202
- <h1>sing up</h1>
203
-
204
- <label for="username">Usuario:</label>
205
- {{ form.username }}
206
-
207
- <label for="password1">Contraseña:</label>
208
- {{ form.password1 }}
209
-
210
- <label for="password2">Confirmar Contraseña:</label>
211
- {{ form.password2 }}
212
-
213
- <button type="submit">sing Up</button>
214
- </form>
215
- </div>
216
- </div>
217
- {% endblock %}
218
- {% block script %}
219
- <script src="{% static 'js/alertErrors.js'%}"></script>
220
- {% endblock %}""",
193
+ {% block layout %}
194
+ {% if error %}
195
+ <div class="alert" id="alert">
196
+ <div class="alert-content">
197
+ {{ error }}
198
+ <button class="close-btn" onclick="closeAlert()">
199
+ <span class="sr-only">Close</span>
200
+ <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
201
+ <path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
202
+ </svg>
203
+ </button>
204
+ </div>
205
+ </div>
206
+ {% endif %}\n
207
+ <div class="form-wrapper">
208
+ <div class="form-container">
209
+ <form action="" method="post" class="form-control">
210
+ {% csrf_token %}
211
+ <h1>sing up</h1>
212
+
213
+ <label for="username">Usuario:</label>
214
+ {{ form.username }}
215
+
216
+ <label for="password1">Contraseña:</label>
217
+ {{ form.password1 }}
218
+
219
+ <label for="password2">Confirmar Contraseña:</label>
220
+ {{ form.password2 }}
221
+
222
+ <button type="submit">sing Up</button>
223
+ </form>
224
+ </div>
225
+ </div>
226
+ {% endblock %}
227
+ {% block script %}
228
+ <script src="{% static 'js/alertErrors.js'%}"></script>
229
+ {% endblock %}""",
221
230
  'login.html': """{% extends "layouts/index.html" %}
222
- {% block layout %}
223
- {% if error %}
224
- <div class="alert" id="alert">
225
- <div class="alert-content">
226
- {{ error }}
227
- <button class="close-btn" onclick="closeAlert()">
228
- <span class="sr-only">Close</span>
229
- <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
230
- <path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
231
- </svg>
232
- </button>
233
- </div>
234
- </div>
235
- {% endif %}
236
- <div class="form-wrapper">
237
- <div class="form-container">
238
- <form action="" method="post" class="form-control">
239
- {% csrf_token %}
240
- <h1>Login</h1>
241
-
242
- <label for="username">Usuario:</label>
243
- {{ form.username }}
244
-
245
- <label for="password">Contraseña:</label>
246
- <input type="password" id="password" name="password" value="{{ form.password2 }}" required>
247
-
248
- <button type="submit">Login</button>
249
- </form>
250
- </div>
251
- </div>
252
- {% endblock %}
253
- {% block script %}
254
- <script src="{% static 'js/alertErrors.js'%}"></script>
255
- {% endblock %}""",
231
+ {% block layout %}
232
+ {% if error %}
233
+ <div class="alert" id="alert">
234
+ <div class="alert-content">
235
+ {{ error }}
236
+ <button class="close-btn" onclick="closeAlert()">
237
+ <span class="sr-only">Close</span>
238
+ <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
239
+ <path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
240
+ </svg>
241
+ </button>
242
+ </div>
243
+ </div>
244
+ {% endif %}
245
+ <div class="form-wrapper">\n
246
+ <div class="form-container">
247
+ <form action="" method="post" class="form-control">
248
+ {% csrf_token %}
249
+ <h1>Login</h1>
250
+
251
+ <label for="username">Usuario:</label>
252
+ {{ form.username }}
253
+
254
+ <label for="password">Contraseña:</label>
255
+ <input type="password" id="password" name="password" value="{{ form.password2 }}" required>
256
+
257
+ <button type="submit">Login</button>
258
+ </form>
259
+ </div>
260
+ </div>
261
+ {% endblock %}
262
+ {% block script %}
263
+ <script src="{% static 'js/alertErrors.js'%}"></script>
264
+ {% endblock %}""",
256
265
  'logged.html': """{% extends "layouts/index.html" %}
257
- {% block layout %}
258
- <div class="layout-container">
259
- <h1>¡Has iniciado sesión!</h1>
260
- </div>
261
- {% endblock %}"""
266
+ {% block layout %}
267
+ <div class="layout-container">
268
+ <h1>¡Has iniciado sesión!</h1>
269
+ </div>
270
+ {% endblock %}"""
262
271
  }
263
272
  for template_file, content in template_files.items():
264
273
  template_file_path = os.path.join(templates_dir, template_file)
@@ -267,25 +276,14 @@ class Command(BaseCommand):
267
276
 
268
277
  # escritura de los archivos
269
278
 
270
- # definiendoerrores
271
-
272
- def write_file(file_path, content):
273
- try:
274
- with open(file_path, 'w') as file:
275
- file.write(content)
276
- print(f"Archivo escrito correctamente: {file_path}")
277
- except Exception as e:
278
- print(f"Error al escribir el archivo {file_path}: {e}")
279
-
280
279
  # escritura del archivos js
281
- write_file(js_file_path, """
282
- function closeAlert() {
283
- const alert = document.getElementById('alert');
284
- if (alert) {
285
- alert.remove();
286
- }
287
- }
288
- """)
280
+ write_file(js_file_path, """function closeAlert() {
281
+ const alert = document.getElementById('alert');
282
+ if (alert) {
283
+ alert.remove();
284
+ }
285
+ }
286
+ """)
289
287
 
290
288
  # escritura del archivo css
291
289
  write_file(css_file_path, """
@@ -503,8 +501,7 @@ button[type="submit"]:hover {
503
501
  }
504
502
  """)
505
503
  # escritura del archivos que estan en la carpeta layouts
506
- write_file(layout_files_path, """
507
- {% load static %}
504
+ write_file(layout_files_path, """{% load static %}
508
505
  <!DOCTYPE html>
509
506
  <html lang="en">
510
507
  <head>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.6
3
+ Version: 1.0.8
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.6',
5
+ version='1.0.8',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',