rocketdoo 1.2__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,7 +57,7 @@ If the Library as you received it specifies that a proxy can decide whether futu
57
57
  <div Rocketdoo=""></div>
58
58
 
59
59
  Licencia: LGPL-3.0+
60
- Versión: "1.2"
60
+ Versión: "1.2.2"
61
61
  Autor: Horacio Montaño, Elias Braceras
62
62
  Fecha: 16/10/2024
63
63
  Descripción: Framework to development Odoo
@@ -1,19 +1,31 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: rocketdoo
3
- Version: 1.2
3
+ Version: 1.2.2
4
4
  Summary: This library allows you to build an automated local development environment for Odoo EE and CE.
5
5
  Home-page: https://github.com/HDM-soft/rocketdoo.git
6
6
  Author: Horacio Montaño and Elias Braceras
7
7
  Author-email: horaciomontano@hdmsoft.com.ar
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
+ Requires-Dist: copier
11
+ Dynamic: author
12
+ Dynamic: author-email
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: home-page
16
+ Dynamic: license-file
17
+ Dynamic: requires-dist
18
+ Dynamic: summary
10
19
 
11
- # HDMsoft
12
- [visit our page](https://odoo.hdmsoft.com.ar)
20
+ # HDMSOFT
21
+
22
+ [Visit our page](https://odoo.hdmsoft.com.ar)
23
+
24
+ [Official Documentation](https://rocketdoo-docs.readthedocs.io/en/latest/)
13
25
 
14
26
  ## ROCKETDOO
15
27
 
16
- Base repository for Odoo development.
28
+ Odoo Development Framework
17
29
 
18
30
  ## Developed by:
19
31
 
@@ -21,7 +33,7 @@ Base repository for Odoo development.
21
33
  - "Horacio Montaño"
22
34
 
23
35
  ## Version:
24
- - "1.2"
36
+ - "1.2.2"
25
37
 
26
38
  ----------------------------------------------------------------------------------------------------------------------------------------------------------
27
39
 
@@ -135,6 +147,10 @@ If you modify your **gitman.yml** file before building with the "build" command,
135
147
 
136
148
  - If you have any questions or issues with our development environment, you can contact us and submit your inquiry or support ticket by clicking on the link below.
137
149
 
138
- - [Support Link](https://odoo.hdmsoft.com.ar/contactus)
150
+ - [Support Link](https://odoo.hdmsoft.com.ar/mesa-de-ayuda)
151
+
152
+ - If you like this project, and you want to collaborate with a donation, you can do it here !!!
139
153
 
154
+ - [Cafecito](https://cafecito.app/horacio1986)
155
+ - [Patreon](https://cafecito.app/horacio1986)
140
156
 
@@ -1,9 +1,12 @@
1
- # HDMsoft
2
- [visit our page](https://odoo.hdmsoft.com.ar)
1
+ # HDMSOFT
2
+
3
+ [Visit our page](https://odoo.hdmsoft.com.ar)
4
+
5
+ [Official Documentation](https://rocketdoo-docs.readthedocs.io/en/latest/)
3
6
 
4
7
  ## ROCKETDOO
5
8
 
6
- Base repository for Odoo development.
9
+ Odoo Development Framework
7
10
 
8
11
  ## Developed by:
9
12
 
@@ -11,7 +14,7 @@ Base repository for Odoo development.
11
14
  - "Horacio Montaño"
12
15
 
13
16
  ## Version:
14
- - "1.2"
17
+ - "1.2.2"
15
18
 
16
19
  ----------------------------------------------------------------------------------------------------------------------------------------------------------
17
20
 
@@ -125,6 +128,10 @@ If you modify your **gitman.yml** file before building with the "build" command,
125
128
 
126
129
  - If you have any questions or issues with our development environment, you can contact us and submit your inquiry or support ticket by clicking on the link below.
127
130
 
128
- - [Support Link](https://odoo.hdmsoft.com.ar/contactus)
131
+ - [Support Link](https://odoo.hdmsoft.com.ar/mesa-de-ayuda)
132
+
133
+ - If you like this project, and you want to collaborate with a donation, you can do it here !!!
129
134
 
135
+ - [Cafecito](https://cafecito.app/horacio1986)
136
+ - [Patreon](https://cafecito.app/horacio1986)
130
137
 
@@ -1,37 +1,79 @@
1
+ import socket
1
2
  import sys
2
3
  import os
4
+ import subprocess
3
5
  import re
4
6
  import yaml
5
7
  import shutil
6
8
 
9
+ def is_port_in_use(port):
10
+ """Check if a TCP port is currently in use on localhost."""
11
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
12
+ return s.connect_ex(('localhost', port)) == 0
13
+
14
+ def is_port_used_by_rocketdoo(port):
15
+ """Check if the port is used by any running Docker container related to Rocketdoo."""
16
+ try:
17
+ output = subprocess.check_output(['docker', 'ps', '--format', '{{.Names}} {{.Ports}}']).decode()
18
+ for line in output.strip().splitlines():
19
+ if 'rocketdoo' in line and str(port) in line:
20
+ return True
21
+ except Exception as e:
22
+ print(f"[ERROR] Could not inspect Docker containers: {e}")
23
+ return False
24
+
25
+ def validate_port_from_int(port, label):
26
+ print(f"[DEBUG] Validating {label} port: {port}")
27
+
28
+ if not isinstance(port, int):
29
+ try:
30
+ port = int(str(port).strip())
31
+ except ValueError:
32
+ print(f"[ERROR] Invalid {label} port. Please ensure it is a valid number.")
33
+ sys.exit(1)
34
+
35
+ if is_port_in_use(port):
36
+ if is_port_used_by_rocketdoo(port):
37
+ print(f"[ERROR] Port {port} is already used by another Rocketdoo project ({label}).")
38
+ else:
39
+ print(f"[ERROR] Port {port} is already in use by another application ({label}).")
40
+ sys.exit(1)
41
+ print(f"[INFO] {label} port {port} is available.")
42
+
43
+ # Validate ports for Odoo, VSCode, and Rocketdoo
44
+ odoo_port = os.getenv("COPIER_odoo_port", 8069)
45
+ vsc_port = os.getenv("COPIER_vsc_port", 8888)
46
+
47
+ validate_port_from_int(odoo_port, "Odoo")
48
+ validate_port_from_int(vsc_port, "VSCode")
7
49
 
8
50
  docker_compose_path = "docker-compose.yml"
9
51
  dockerfile_path = "Dockerfile"
10
52
 
11
53
  # Function to modify docker-compose.yml
12
54
 
13
- def modificar_docker_compose(edicion):
14
- if edicion.lower() == 'ee':
55
+ def modify_docker_compose(edition):
56
+ if edition.lower() == 'ee':
15
57
  try:
16
58
  # Read docker compose at first
17
59
  with open(docker_compose_path, 'r') as file:
18
- contenido = file.readlines()
60
+ content = file.readlines()
19
61
 
20
62
  # Modify content memory
21
- contenido_modificado = []
22
- for linea in contenido:
63
+ modified_content = []
64
+ for line in content:
23
65
  # Check if the line has the specific pattern
24
- if linea.lstrip().startswith('#- ./enterprise:/usr/lib/python3/dist-packages/odoo/enterprise'):
66
+ if line.lstrip().startswith('#- ./enterprise:/usr/lib/python3/dist-packages/odoo/enterprise'):
25
67
  # Remove only the '#' symbol that appears after the spaces, without affecting the indentation.
26
- indentacion = len(linea) - len(linea.lstrip())
27
- linea = ' ' * indentacion + linea.lstrip().lstrip('#').lstrip()
28
- contenido_modificado.append(linea)
68
+ indentation = len(line) - len(line.lstrip())
69
+ line = ' ' * indentation + line.lstrip().lstrip('#').lstrip()
70
+ modified_content.append(line)
29
71
  else:
30
- contenido_modificado.append(linea)
72
+ modified_content.append(line)
31
73
 
32
74
  # Writes the modified content back to the file
33
75
  with open(docker_compose_path, 'w') as file:
34
- file.writelines(contenido_modificado)
76
+ file.writelines(modified_content)
35
77
 
36
78
  print("Environment prepared for the Enterprise edition. Be sure to upload your Enterprise folder to the root of the project.")
37
79
  except FileNotFoundError:
@@ -40,34 +82,34 @@ def modificar_docker_compose(edicion):
40
82
  print(f"Error modifying {docker_compose_path}: {e}")
41
83
 
42
84
  # Function to modify the odoo.conf file
43
- def modificar_odoo_conf(edicion):
85
+ def modify_odoo_conf(edition):
44
86
  odoo_conf_path = os.path.join("config", "odoo.conf")
45
87
 
46
- if edicion.lower() == 'ee':
88
+ if edition.lower() == 'ee':
47
89
  # Ensure that the file exists
48
90
  if not os.path.exists(odoo_conf_path):
49
91
  print(f"The file {odoo_conf_path} does not exist.")
50
92
  return
51
93
 
52
94
  with open(odoo_conf_path, 'r') as file:
53
- contenido = file.read()
95
+ content = file.read()
54
96
 
55
97
  # Add enterprise path to addons_path
56
98
  addons_path = "/usr/lib/python3/dist-packages/odoo/enterprise"
57
- contenido_modificado = re.sub(r'(addons_path\s*=\s*)(.*)', r'\1\2,{}'.format(addons_path), contenido)
99
+ modified_content = re.sub(r'(addons_path\s*=\s*)(.*)', r'\1\2,{}'.format(addons_path), content)
58
100
 
59
101
  with open(odoo_conf_path, 'w') as file:
60
- file.write(contenido_modificado)
102
+ file.write(modified_content)
61
103
 
62
104
  print("Modified odoo.conf file to include the Enterprise path.")
63
105
 
64
106
  # Ask for the odoo edition
65
- edicion = input("In which Odoo edition will you develop? Community or Enterprise (ce/ee): ").strip().lower()
107
+ edition = input("In which Odoo edition will you develop? Community or Enterprise (ce/ee): ").strip().lower()
66
108
 
67
109
  # Apply modifications if Enterprise edition
68
- if edicion == 'ee':
69
- modificar_docker_compose(edicion)
70
- modificar_odoo_conf(edicion)
110
+ if edition == 'ee':
111
+ modify_docker_compose(edition)
112
+ modify_odoo_conf(edition)
71
113
  else:
72
114
  print("Community Edition Selected")
73
115
 
@@ -89,17 +131,17 @@ def get_input(prompt, required=True):
89
131
 
90
132
 
91
133
 
92
- def manejar_ssh(repos_privados, dockerfile_path):
93
- """Maneja las claves SSH según si se utilizan repositorios privados."""
94
- if not repos_privados:
134
+ def manage_ssh(private_repos, dockerfile_path):
135
+ """Handles SSH keys depending on whether private repositories are used."""
136
+ if not private_repos:
95
137
  print("No private repositories will be used. SSH keys will not be modified.")
96
138
  return
97
139
 
98
- ssh_folder = os.path.expanduser("~/.ssh") # Carpeta del usuario
99
- build_context_ssh_folder = os.path.join(os.path.dirname(dockerfile_path), ".ssh") # Contexto de construcción
140
+ ssh_folder = os.path.expanduser("~/.ssh") # User folder
141
+ build_context_ssh_folder = os.path.join(os.path.dirname(dockerfile_path), ".ssh") # Construction context
100
142
 
101
143
  try:
102
- # Buscar claves privadas en ~/.ssh
144
+ # Search for private keys in ~/.ssh
103
145
  if not os.path.exists(ssh_folder):
104
146
  print(f"The {ssh_folder} folder was not found. Make sure you have SSH keys configured.")
105
147
  return
@@ -117,22 +159,22 @@ def manejar_ssh(repos_privados, dockerfile_path):
117
159
  for i, key in enumerate(ssh_keys):
118
160
  print(f"{i + 1}. {key}")
119
161
 
120
- key_index = int(get_input("Selecciona el número de la clave que deseas usar: ")) - 1
162
+ key_index = int(get_input("Select the number of the key you wish to use: ")) - 1
121
163
  selected_key = ssh_keys[key_index]
122
164
  print(f"You have selected the key: {selected_key}")
123
165
 
124
- # Crear la carpeta .ssh en el contexto de construcción si no existe
166
+ # Create the folder .ssh in the context of construction if it doesn`t exist
125
167
  if not os.path.exists(build_context_ssh_folder):
126
168
  os.makedirs(build_context_ssh_folder)
127
169
 
128
- # Copiar la clave seleccionada al contexto de construcción
170
+ # Copy the selected key to the build context
129
171
  source_key_path = os.path.join(ssh_folder, selected_key)
130
172
  dest_key_path = os.path.join(build_context_ssh_folder, selected_key)
131
173
  shutil.copy(source_key_path, dest_key_path)
132
174
 
133
175
  print(f"Key {selected_key} copied to the construction context: {dest_key_path}")
134
176
 
135
- # Modificar el Dockerfile para usar la clave copiada
177
+ # Modify the Dockerfile to use the copied key
136
178
  with open(dockerfile_path, "r") as file:
137
179
  lines = file.readlines()
138
180
 
@@ -162,7 +204,7 @@ def manejar_ssh(repos_privados, dockerfile_path):
162
204
 
163
205
 
164
206
 
165
- def comentar_lineas():
207
+ def comment_lines():
166
208
  """Comment out specific lines in the Dockerfile."""
167
209
  copy_line = "COPY ./gitman.yml /usr/lib/python3/dist-packages/odoo/\n"
168
210
  gitman_line = "RUN gitman install -r /usr/lib/python3/dist-packages/odoo/\n"
@@ -187,31 +229,31 @@ def comentar_lineas():
187
229
 
188
230
 
189
231
  # Function to validate user input
190
- def obtener_respuesta_si_no(mensaje):
232
+ def get_answer_yes_no(message):
191
233
  while True:
192
- respuesta = input(mensaje).strip().lower()
193
- if respuesta in ["y", "n"]:
194
- return respuesta
234
+ answer = input(message).strip().lower()
235
+ if answer in ["y", "n"]:
236
+ return answer
195
237
  else:
196
238
  print("Please enter 'y' for yes or 'n' for no.")
197
239
 
198
240
 
199
241
  # Ask if the user wants to use private repositories
200
- usar_repos_privados = input("Do you want to use private repositories (y/n): ").strip().lower()
242
+ use_private_repos = input("Do you want to use private repositories (y/n): ").strip().lower()
201
243
 
202
244
 
203
245
  # Handle SSH in the Dockerfile based on user response
204
- manejar_ssh(usar_repos_privados == "y", dockerfile_path)
246
+ manage_ssh(use_private_repos == "y", dockerfile_path)
205
247
 
206
248
  # Ask if the user wants to user gitman with public repositorie
207
- usar_gitman = input("Do you want to use third-party repositories (y/n): ").strip().lower()
249
+ use_gitman = input("Do you want to use third-party repositories (y/n): ").strip().lower()
208
250
 
209
- if usar_gitman != "y":
251
+ if use_gitman != "y":
210
252
  if os.path.exists("gitman.yml"):
211
253
  os.remove("gitman.yml")
212
254
 
213
255
  print("Not use third-party repositories. Commenting lines of the Dockerfile...")
214
- comentar_lineas()
256
+ comment_lines()
215
257
  sys.exit(0)
216
258
 
217
259
 
@@ -226,7 +268,7 @@ config = {
226
268
  }
227
269
 
228
270
 
229
- def agregar_repositorio():
271
+ def add_repository():
230
272
  """Functions to add new repositories"""
231
273
  repo_info = {
232
274
  "repo": get_input("Write or paste the repository (URL): "),
@@ -243,7 +285,7 @@ def agregar_repositorio():
243
285
 
244
286
 
245
287
  # Function to modify the odoo.conf file in the config folder
246
- def modificar_odoo_conf():
288
+ def modify_odoo_conf():
247
289
  """Modify the addons_path line in config/odoo.conf by adding the new repositories"""
248
290
  try:
249
291
  # Path to the odoo.conf file in the config folder
@@ -270,21 +312,21 @@ def modificar_odoo_conf():
270
312
  gitman_data = yaml.safe_load(file)
271
313
 
272
314
  # We extract the values of 'name' from each repository in sources, making sure not to include empty ones.
273
- nombres_repositorios = [
315
+ repositories_name = [
274
316
  repo["name"] for repo in gitman_data["sources"] if repo["name"]
275
317
  ]
276
- print(f"Extracted repositories: {nombres_repositorios}")
318
+ print(f"Extracted repositories: {repositories_name}")
277
319
 
278
320
  # If there are no repository names, we do nothing.
279
- if not nombres_repositorios:
321
+ if not repositories_name:
280
322
  print("No repositories were found to add.")
281
323
  return
282
324
 
283
325
  # We create the new string for addons_path with the new paths
284
- nuevas_rutas = ",".join(
326
+ new_routes = ",".join(
285
327
  [
286
- f"/usr/lib/python3/dist-packages/odoo/external_addons/{nombre}"
287
- for nombre in nombres_repositorios
328
+ f"/usr/lib/python3/dist-packages/odoo/external_addons/{name}"
329
+ for name in repositories_name
288
330
  ]
289
331
  )
290
332
 
@@ -293,27 +335,27 @@ def modificar_odoo_conf():
293
335
  lines = file.readlines()
294
336
 
295
337
  # We look for the line containing addons_path
296
- addons_path_encontrado = False
338
+ addons_path_found = False
297
339
  for i, line in enumerate(lines):
298
340
  if line.startswith("addons_path ="):
299
341
  # We add the new routes to the existing line, if they are not already there.
300
- linea_actual = line.strip().split(" = ")[1]
301
- lineas_rutas_existentes = linea_actual.split(",")
342
+ current_line = line.strip().split(" = ")[1]
343
+ existing_routes_lines = current_line.split(",")
302
344
 
303
345
  # We add the new routes to the existing ones, if they are not already there.
304
- rutas_actualizadas = lineas_rutas_existentes + [
305
- ruta
306
- for ruta in nuevas_rutas.split(",")
307
- if ruta not in lineas_rutas_existentes
346
+ update_routes = existing_routes_lines + [
347
+ route
348
+ for route in new_routes.split(",")
349
+ if route not in existing_routes_lines
308
350
  ]
309
- lines[i] = f"addons_path = {','.join(rutas_actualizadas)}\n"
310
- addons_path_encontrado = True
351
+ lines[i] = f"addons_path = {','.join(update_routes)}\n"
352
+ addons_path_found = True
311
353
  print(f"addons_path line modified: {lines[i]}")
312
354
  break
313
355
 
314
356
  # If addons_path is not found, we add it at the end
315
- if not addons_path_encontrado:
316
- lines.append(f"addons_path = {nuevas_rutas}\n")
357
+ if not addons_path_found:
358
+ lines.append(f"addons_path = {new_routes}\n")
317
359
  print("A new addons_path line was added.")
318
360
 
319
361
  # Save the changes in the odoo.conf file.
@@ -332,13 +374,13 @@ def modificar_odoo_conf():
332
374
 
333
375
  # Main to add repositories
334
376
  while True:
335
- agregar_repositorio()
377
+ add_repository()
336
378
 
337
379
  # We ask if the user wants to add more repositories
338
- agregar_mas = input("Do you want to add another repository? (y/n): ").strip().lower()
380
+ add_more = input("Do you want to add another repository? (y/n): ").strip().lower()
339
381
 
340
382
  # Validating answer
341
- if agregar_mas != "y":
383
+ if add_more != "y":
342
384
  print("Finished configuring gitman to third-party repository.")
343
385
  break
344
386
 
@@ -349,4 +391,4 @@ with open("gitman.yml", "w") as file:
349
391
  print("File gitman.yml generated successfully.")
350
392
 
351
393
  # Calling function to modify odoo.conf
352
- modificar_odoo_conf()
394
+ modify_odoo_conf()
@@ -4,7 +4,7 @@ import signal
4
4
  import sys
5
5
 
6
6
  # Define la versión del paquete
7
- VERSION = "1.2"
7
+ VERSION = "1.2.2"
8
8
 
9
9
  # Maneja la interrupción con Ctrl+C
10
10
  def signal_handler(sig, frame):
@@ -1,19 +1,31 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: rocketdoo
3
- Version: 1.2
3
+ Version: 1.2.2
4
4
  Summary: This library allows you to build an automated local development environment for Odoo EE and CE.
5
5
  Home-page: https://github.com/HDM-soft/rocketdoo.git
6
6
  Author: Horacio Montaño and Elias Braceras
7
7
  Author-email: horaciomontano@hdmsoft.com.ar
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
+ Requires-Dist: copier
11
+ Dynamic: author
12
+ Dynamic: author-email
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: home-page
16
+ Dynamic: license-file
17
+ Dynamic: requires-dist
18
+ Dynamic: summary
10
19
 
11
- # HDMsoft
12
- [visit our page](https://odoo.hdmsoft.com.ar)
20
+ # HDMSOFT
21
+
22
+ [Visit our page](https://odoo.hdmsoft.com.ar)
23
+
24
+ [Official Documentation](https://rocketdoo-docs.readthedocs.io/en/latest/)
13
25
 
14
26
  ## ROCKETDOO
15
27
 
16
- Base repository for Odoo development.
28
+ Odoo Development Framework
17
29
 
18
30
  ## Developed by:
19
31
 
@@ -21,7 +33,7 @@ Base repository for Odoo development.
21
33
  - "Horacio Montaño"
22
34
 
23
35
  ## Version:
24
- - "1.2"
36
+ - "1.2.2"
25
37
 
26
38
  ----------------------------------------------------------------------------------------------------------------------------------------------------------
27
39
 
@@ -135,6 +147,10 @@ If you modify your **gitman.yml** file before building with the "build" command,
135
147
 
136
148
  - If you have any questions or issues with our development environment, you can contact us and submit your inquiry or support ticket by clicking on the link below.
137
149
 
138
- - [Support Link](https://odoo.hdmsoft.com.ar/contactus)
150
+ - [Support Link](https://odoo.hdmsoft.com.ar/mesa-de-ayuda)
151
+
152
+ - If you like this project, and you want to collaborate with a donation, you can do it here !!!
139
153
 
154
+ - [Cafecito](https://cafecito.app/horacio1986)
155
+ - [Patreon](https://cafecito.app/horacio1986)
140
156
 
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text()
6
6
 
7
7
  setup(
8
8
  name='rocketdoo',
9
- version='1.2',
9
+ version='1.2.2',
10
10
  description='This library allows you to build an automated local development environment for Odoo EE and CE.',
11
11
  long_description=long_description,
12
12
  long_description_content_type='text/markdown',
File without changes
File without changes