componentsDjangoType 2.0.35__tar.gz → 2.0.36__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.0.35/componentsDjangoType.egg-info → componentsdjangotype-2.0.36}/PKG-INFO +1 -1
  2. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  3. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType.egg-info/SOURCES.txt +8 -1
  4. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/services/authenticator_configurator.py +9 -9
  5. componentsdjangotype-2.0.36/services/copy_source.py +31 -0
  6. componentsdjangotype-2.0.36/services/utils/css/authentication.css +211 -0
  7. componentsdjangotype-2.0.36/services/utils/js/alertErrors.js +6 -0
  8. componentsdjangotype-2.0.36/services/utils/views/home.html +4 -0
  9. componentsdjangotype-2.0.36/services/utils/views/layouts/index.html +40 -0
  10. componentsdjangotype-2.0.36/services/utils/views/logged.html +6 -0
  11. componentsdjangotype-2.0.36/services/utils/views/login.html +33 -0
  12. componentsdjangotype-2.0.36/services/utils/views/singup.html +36 -0
  13. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/setup.py +9 -1
  14. componentsdjangotype-2.0.35/services/copy_source.py +0 -32
  15. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/LICENSE +0 -0
  16. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/MANIFEST.in +0 -0
  17. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/README.md +0 -0
  18. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/__init__.py +0 -0
  19. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
  20. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/management/__init__.py +0 -0
  21. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
  22. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/management/commands/__init__.py +0 -0
  23. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
  24. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
  25. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/management/commands/createApp.py +0 -0
  26. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  27. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  28. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType.egg-info/requires.txt +0 -0
  29. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/componentsDjangoType.egg-info/top_level.txt +0 -0
  30. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/services/__init__.py +0 -0
  31. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/services/authentication/__init__.py +0 -0
  32. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/services/authentication/auth.py +0 -0
  33. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/services/authentication/forms.py +0 -0
  34. {componentsdjangotype-2.0.35 → componentsdjangotype-2.0.36}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.0.35
3
+ Version: 2.0.36
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.0.35
3
+ Version: 2.0.36
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
@@ -21,4 +21,11 @@ services/authenticator_configurator.py
21
21
  services/copy_source.py
22
22
  services/authentication/__init__.py
23
23
  services/authentication/auth.py
24
- services/authentication/forms.py
24
+ services/authentication/forms.py
25
+ services/utils/css/authentication.css
26
+ services/utils/js/alertErrors.js
27
+ services/utils/views/home.html
28
+ services/utils/views/logged.html
29
+ services/utils/views/login.html
30
+ services/utils/views/singup.html
31
+ services/utils/views/layouts/index.html
@@ -238,16 +238,16 @@ urlpatterns = [
238
238
  stdout.write("Estructura de carpetas creada.\n")
239
239
 
240
240
  files_to_copy = [
241
- ("services/utils/js/alertErrors.js", os.path.join(js_dir, "alertErrors.js")),
242
- ("services/utils/css/authentication.css", os.path.join(css_dir, "authentication.css")),
243
- ("services/utils/views/layouts/index.html", os.path.join(layouts_dir, "index.html")),
244
- ("services/utils/views/home.html", os.path.join(templates_dir, "home.html")),
245
- ("services/utils/views/singup.html", os.path.join(templates_dir, "singup.html")),
246
- ("services/utils/views/login.html", os.path.join(templates_dir, "login.html")),
247
- ("services/utils/views/logged.html", os.path.join(templates_dir, "logged.html")),
241
+ ("services.utils.js", "alertErrors.js", os.path.join(js_dir, "alertErrors.js")),
242
+ ("services.utils.css", "authentication.css", os.path.join(css_dir, "authentication.css")),
243
+ ("services.utils.views.layouts", "index.html", os.path.join(layouts_dir, "index.html")),
244
+ ("services.utils.views", "home.html", os.path.join(templates_dir, "home.html")),
245
+ ("services.utils.views", "singup.html", os.path.join(templates_dir, "singup.html")),
246
+ ("services.utils.views", "login.html", os.path.join(templates_dir, "login.html")),
247
+ ("services.utils.views", "logged.html", os.path.join(templates_dir, "logged.html")),
248
248
  ]
249
249
 
250
- for source_path, destination_path in files_to_copy:
251
- copy_static_file(source_path, destination_path, stdout)
250
+ for package, resource_name, destination_path in files_to_copy:
251
+ copy_static_file(package, resource_name, destination_path, stdout)
252
252
 
253
253
  stdout.write("Archivos estáticos copiados.\n")
@@ -0,0 +1,31 @@
1
+ import importlib.resources as pkg_resources # Para acceder a recursos del paquete
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")
@@ -0,0 +1,211 @@
1
+ .navbar {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ padding: 10px 20px;
6
+ background-color: #333; /* Color de fondo */
7
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
8
+ }
9
+
10
+ /* Logo */
11
+ .navbar .logo a {
12
+ color: #ffffff;
13
+ font-size: 1.5em;
14
+ text-decoration: none;
15
+ transition: color 0.3s ease;
16
+ }
17
+
18
+ .navbar .logo a:hover {
19
+ color: #4a90e2; /* Hover del logo */
20
+ }
21
+
22
+ /* Links de navegación */
23
+ .nav-links {
24
+ display: flex;
25
+ gap: 15px;
26
+ list-style: none;
27
+ margin: 0;
28
+ padding: 0;
29
+ }
30
+
31
+ .nav-links .nav-item {
32
+ color: #ffffff;
33
+ font-size: 1em;
34
+ text-decoration: none;
35
+ padding: 8px 15px;
36
+ border-radius: 5px;
37
+ transition: background-color 0.3s ease, color 0.3s ease;
38
+ }
39
+
40
+ .nav-links .nav-item:hover {
41
+ background-color: #4a90e2; /* Hover */
42
+ color: #ffffff;
43
+ }
44
+
45
+ /* Estilos para dispositivos móviles */
46
+ .menu-toggle {
47
+ display: none;
48
+ }
49
+
50
+ @media (max-width: 768px) {
51
+ .menu-toggle {
52
+ display: inline-block;
53
+ font-size: 1.5em;
54
+ color: #ffffff;
55
+ cursor: pointer;
56
+ padding: 8px 15px;
57
+ }
58
+
59
+ .nav-links {
60
+ flex-direction: column;
61
+ position: absolute;
62
+ top: 100%;
63
+ right: 0;
64
+ width: 100%;
65
+ background-color: #333;
66
+ max-height: 0;
67
+ overflow: hidden;
68
+ transition: max-height 0.3s ease;
69
+ }
70
+
71
+ /* Activar menú desplegable */
72
+ .nav-links.active {
73
+ max-height: 300px; /* Ajustar altura */
74
+ }
75
+
76
+ .nav-links .nav-item {
77
+ padding: 10px 20px;
78
+ }
79
+ }
80
+
81
+ /* formularios */
82
+ /* Contenedor para centrar el formulario */
83
+ .form-wrapper {
84
+ display: flex;
85
+ justify-content: center;
86
+ align-items: center;
87
+ margin-top: 50px;
88
+ }
89
+
90
+ /* Contenedor del formulario */
91
+ .form-container {
92
+ padding: 20px;
93
+ background: black; /* Fondo azul con transparencia */
94
+ border-radius: 8px;
95
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
96
+ color: white;
97
+ text-align: center;
98
+ max-width: 400px;
99
+ width: 100%;
100
+ }
101
+
102
+ /* Estilo del formulario */
103
+ .form-control {
104
+ display: flex;
105
+ flex-direction: column;
106
+ gap: 15px;
107
+ }
108
+
109
+ /* Estilo para las etiquetas */
110
+ label {
111
+ font-size: 0.9em;
112
+ color: #d1d5db; /* Color gris claro */
113
+ margin-bottom: 5px;
114
+ text-align: left;
115
+ }
116
+
117
+ /* Estilo para los campos de entrada */
118
+ input[type="text"],
119
+ input[type="password"] {
120
+ padding: 10px;
121
+ background: rgba(255, 255, 255, 0.2);
122
+ border: 1px solid rgba(255, 255, 255, 0.3);
123
+ border-radius: 5px;
124
+ color: #ffffff;
125
+ outline: none;
126
+ font-size: 1em;
127
+ transition: background 0.3s ease, box-shadow 0.3s ease;
128
+ }
129
+
130
+ input[type="text"]:focus,
131
+ input[type="password"]:focus {
132
+ background: rgba(255, 255, 255, 0.4);
133
+ box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
134
+ }
135
+
136
+ /* Estilo del botón */
137
+ button[type="submit"] {
138
+ padding: 10px;
139
+ background: #4a90e2;
140
+ color: white;
141
+ border: none;
142
+ border-radius: 5px;
143
+ cursor: pointer;
144
+ transition: background 0.3s ease;
145
+ }
146
+
147
+ button[type="submit"]:hover {
148
+ background: #357ab8;
149
+ }
150
+
151
+ /* alert */
152
+
153
+ /* Estilos para la alerta */
154
+ .alert {
155
+ max-width: 400px;
156
+ background-color: #333;
157
+ color: #ffffff;
158
+ border-radius: 8px;
159
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
160
+ margin: 0 auto;
161
+ position: relative;
162
+ top: 20px;
163
+ padding: 15px;
164
+ }
165
+
166
+ .alert-content {
167
+ display: flex;
168
+ justify-content: space-between;
169
+ align-items: center;
170
+ }
171
+
172
+ .close-btn {
173
+ background: none;
174
+ border: none;
175
+ cursor: pointer;
176
+ color: #ffffff;
177
+ transition: color 0.3s ease;
178
+ }
179
+
180
+ .close-btn:hover {
181
+ color: #ff6b6b;
182
+ }
183
+
184
+ .close-icon {
185
+ width: 16px;
186
+ height: 16px;
187
+ }
188
+
189
+ /* logged */
190
+
191
+ /* Estilos para el contenedor del bloque */
192
+ .layout-container {
193
+ display: flex;
194
+ justify-content: center;
195
+ align-items: center;
196
+ height: 100vh;
197
+ background-color: #f0f4f8;
198
+ font-family: Arial, sans-serif;
199
+ }
200
+
201
+ /* Estilos para el título */
202
+ .layout-container h1 {
203
+ font-size: 2.5rem;
204
+ color: #4a90e2;
205
+ font-weight: bold;
206
+ text-align: center;
207
+ padding: 20px;
208
+ border-radius: 8px;
209
+ background: #ffffff;
210
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
211
+ }
@@ -0,0 +1,6 @@
1
+ function closeAlert() {
2
+ const alert = document.getElementById('alert');
3
+ if (alert) {
4
+ alert.remove();
5
+ }
6
+ }
@@ -0,0 +1,4 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ <h1>welcome</h1>
4
+ {% endblock %}
@@ -0,0 +1,40 @@
1
+ {% load static %}
2
+ <!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <link rel="stylesheet" href="{% static 'css/authentication.css' %}">
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
9
+ <title>django components</title>
10
+ </head>
11
+ <body class="bg-gray-100 text-gray-800">
12
+
13
+ <nav class="navbar">
14
+ <div class="logo">
15
+ <a href="{% url 'home' %}">
16
+ <i class="fa-solid fa-house"></i>
17
+ </a>
18
+ </div>
19
+ <div class="menu-toggle">
20
+ <i class="fa fa-bars"></i>
21
+ </div>
22
+ <ul class="nav-links">
23
+ {% if user.is_authenticated %}
24
+ <li><a href="{% url 'logout' %}" class="nav-item">Logout</a></li>
25
+ {% else %}
26
+ <li><a href="{% url 'signup' %}" class="nav-item">Sign Up</a></li>
27
+ <li><a href="{% url 'login' %}" class="nav-item">Login</a></li>
28
+ {% endif %}
29
+ </ul>
30
+ </nav>
31
+
32
+ <div class="container mx-auto p-4">
33
+ {% block layout %}
34
+ {% endblock %}
35
+ </div>
36
+
37
+
38
+ <script src="{% static 'js/alertErrors.js'%}"></script>
39
+ </body>
40
+ </html>
@@ -0,0 +1,6 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ <div class="layout-container">
4
+ <h1>¡Has iniciado sesión!</h1>
5
+ </div>
6
+ {% endblock %}
@@ -0,0 +1,33 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ {% if error %}
4
+ <div class="alert" id="alert">
5
+ <div class="alert-content">
6
+ {{ error }}
7
+ <button class="close-btn" onclick="closeAlert()">
8
+ <span class="sr-only">Close</span>
9
+ <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ <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"/>
11
+ </svg>
12
+ </button>
13
+ </div>
14
+ </div>
15
+ {% endif %}
16
+
17
+ <div class="form-wrapper">
18
+ <div class="form-container">
19
+ <form action="" method="post" class="form-control">
20
+ {% csrf_token %}
21
+ <h1>Login</h1>
22
+
23
+ <label for="username">Usuario:</label>
24
+ {{ form.username }}
25
+
26
+ <label for="password">Contraseña:</label>
27
+ <input type="password" id="password" name="password" value="{{ form.password2 }}" required>
28
+
29
+ <button type="submit">Login</button>
30
+ </form>
31
+ </div>
32
+ </div>
33
+ {% endblock %}
@@ -0,0 +1,36 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ {% if error %}
4
+ <div class="alert" id="alert">
5
+ <div class="alert-content">
6
+ {{ error }}
7
+ <button class="close-btn" onclick="closeAlert()">
8
+ <span class="sr-only">Close</span>
9
+ <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ <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"/>
11
+ </svg>
12
+ </button>
13
+ </div>
14
+ </div>
15
+ {% endif %}
16
+
17
+ <div class="form-wrapper">
18
+ <div class="form-container">
19
+ <form action="" method="post" class="form-control">
20
+ {% csrf_token %}
21
+ <h1>sing up</h1>
22
+
23
+ <label for="username">Usuario:</label>
24
+ {{ form.username }}
25
+
26
+ <label for="password1">Contraseña:</label>
27
+ {{ form.password1 }}
28
+
29
+ <label for="password2">Confirmar Contraseña:</label>
30
+ {{ form.password2 }}
31
+
32
+ <button type="submit">sing Up</button>
33
+ </form>
34
+ </div>
35
+ </div>
36
+ {% endblock %}
@@ -2,9 +2,17 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='2.0.35',
5
+ version='2.0.36',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
+ package_data={
9
+ 'services': [
10
+ 'utils/js/*.js',
11
+ 'utils/css/*.css',
12
+ 'utils/views/*.html',
13
+ 'utils/views/layouts/*.html',
14
+ ],
15
+ },
8
16
  license='MIT',
9
17
  description='Comandos para crear archivos html, css y js',
10
18
  long_description=open('README.md').read(),
@@ -1,32 +0,0 @@
1
- import os
2
- import shutil
3
- import sys
4
-
5
- def copy_static_file(source_path, destination_path, stdout=sys.stdout):
6
- """
7
- Copia un archivo estático (HTML, CSS, JS) a una ruta de destino.
8
-
9
- :param source_path: Ruta completa del archivo fuente.
10
- :param destination_path: Ruta completa del archivo destino.
11
- :param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
12
- """
13
- try:
14
- # Verificar si el archivo fuente existe
15
- if not os.path.exists(source_path):
16
- stdout.write(f"El archivo fuente '{source_path}' no existe.\n")
17
- return
18
-
19
- # Crear el directorio de destino si no existe
20
- os.makedirs(os.path.dirname(destination_path), exist_ok=True)
21
-
22
- # Verificar si el archivo de destino ya existe
23
- if os.path.exists(destination_path):
24
- stdout.write(f"El archivo '{destination_path}' ya existe.\n")
25
- return
26
-
27
- # Copiar el archivo al destino
28
- shutil.copy(source_path, destination_path)
29
- stdout.write(f"El archivo '{source_path}' fue copiado a '{destination_path}'.\n")
30
-
31
- except Exception as e:
32
- stdout.write(f"Error al copiar el archivo: {e}\n")