Skip to content

Commit bd98132

Browse files
committed
Más cambios
1 parent 7eaab39 commit bd98132

3 files changed

Lines changed: 324 additions & 79 deletions

File tree

‎README.md‎

Lines changed: 52 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,80 @@
1+
# Index Generator for KiCad
12

2-
# Generador de Índice para KiCad
3+
This project is a Python tool that allows you to automatically generate an index (or table of contents) for KiCad schematics. It includes options to customize font sizes, language, column spacing, and so you can tailor the index to your needs.
34

4-
Este proyecto es una herramienta en Python que permite generar de forma automatizada un índice (o tabla de contenido) para esquemáticos de KiCad. Incluye opciones para personalizar tamaños de fuente, idioma, distancias entre columnas y más, de manera que puedas ajustar el índice a tus necesidades.
5+
## What is it for?
56

6-
## ¿Para qué sirve?
7-
8-
- Facilita la creación de un índice de páginas dentro de un proyecto de KiCad.
9-
- Permite añadir y editar páginas desde una interfaz gráfica (Tkinter).
10-
- Genera el texto en el formato correcto para KiCad (versión 7 o superior).
11-
- Ofrece la posibilidad de copiar el resultado al portapapeles para pegarlo directamente en KiCad.
12-
- Permite guardar la configuración y el índice en un archivo `.sch`, así como recargarlo en cualquier momento.
7+
- Facilitates the creation of a page index within a KiCad project.
8+
- Allows adding and editing pages through a graphical interface (Tkinter).
9+
- Generates text in the correct format for KiCad (version 8 or higher)(could works in previous version, but NOT TESTED).
10+
- Offers the option to copy the result to the clipboard for direct pasting into KiCad.
11+
- Enables saving the configuration and index to a `.sch` file, as well as reloading it at any time.
1312

1413
![alt text](doc/image.png)
1514

16-
Este es el estilo de índice uqe crea el script
15+
This is the style of the index that the script generates.
1716

18-
## Características
17+
## Features
1918

20-
- **Interfaz gráfica sencilla**: Añade, edita o elimina páginas mediante cuadros de diálogo.
21-
- **Ajuste de fuentes**: Cambia el tamaño del texto para el título, la versión, los encabezados y el contenido de las páginas.
22-
- **Guardado en archivo**:
23-
- Puedes sobrescribir siempre el mismo archivo `indice_generado.sch` (por defecto).
24-
- O bien seleccionar un archivo nuevo cada vez que generes el índice.
25-
- **Carga de índice**: Si ya tenías un índice generado, puedes cargarlo y seguir editándolo.
26-
- **Archivo de configuración `config.ini`**: Todos los valores por defecto (tamaños de fuente, idioma, etc.) están centralizados en un archivo `config.ini`, lo que facilita su modificación sin tocar el código.
19+
- **Simple graphical interface**: Add, edit, or delete pages using dialog boxes.
20+
- **Font adjustment**: Change text size for the title, version, headers, and page content.
21+
- **File saving options**:
22+
- You can always overwrite the same `index_gen.sch` file (default).
23+
- Or select a new file each time you generate the index.
24+
- **Load index**: If you already have a generated index, you can load it and continue editing.
25+
- **`config.ini` configuration file**: All default values (font sizes, language, etc.) are centralized in a `config.ini` file, making it easy to modify settings without changing the code.
2726

28-
## Requisitos
27+
## Requirements
2928

30-
- **Python 3.11+** (o versión posterior).
31-
- **Librerías estándar**: `tkinter`, `configparser`, `json`, `os`, `sys` (vienen incluidas con Python).
32-
- **Pyperclip**: Para copiar el texto al portapapeles. Puedes instalarlo
33-
- **tkinter**: Para la interfaz gráfica. En sistemas Linux, puede que necesites instalar el paquete `python3-tk`.
29+
- **Python 3.11+** (or later)(could works in previous version, but NOT TESTED).
30+
- **Standard libraries**: `tkinter`, `configparser`, `json`, `os`, `sys`.
31+
- **Pyperclip**: For copying text to the clipboard. You can install it with `pip install pyperclip`:
32+
- **Tkinter**: For the graphical interface. On Linux systems, you may need to install the `python3-tk` package.
3433

35-
Puedes instalar **tkinter** en Ubuntu con el siguiente comando:
34+
You can install **tkinter** on Debian based images using the following command:
3635

3736
```bash
3837
sudo apt-get install python3-tk
3938
```
4039

41-
Puedes instalar los requerimientos con el siguiente comando:
40+
You can install the required dependencies (pip) with:
4241

4342
```bash
4443
pip install -r requirements.txt
4544
```
4645

47-
## Instalación y uso
46+
## Installation and Usage
4847

49-
1. **Clona o descarga este repositorio** en tu máquina local.
50-
2. Asegúrate de tener instalado Python 3 y la librería `pyperclip`.
51-
3. Si no existe un archivo `config.ini`, el script creará uno automáticamente con valores por defecto al ejecutarse.
48+
1. **Clone or download this repository** to your local machine.
49+
2. Ensure you have satisfied the requirements.
50+
3. If a `config.ini` file does not exist, the script will automatically create one with default values when executed.
5251

53-
Para **ejecutar** la aplicación:
52+
To **run** the application:
5453

5554
```bash
56-
python index_generator.py
55+
python kicad_index_generator.py
5756
```
5857
```bash
59-
python3 index_generator.py
58+
python3 kicad_index_generator.py
6059
```
6160

62-
*(Asumiendo que el archivo principal se llama `index_generator.py`.)*
61+
*(Assuming the main file is named `kicad_index_generator.py`.)*
6362

64-
### Pasos en la aplicación
63+
### Application Steps
6564

66-
1. **Nombre del Proyecto**: Rellena el campo con el nombre que quieras mostrar en el índice.
67-
2. **Versión**: Indica la versión (por ejemplo, `v2.3`).
68-
3. **Distancia entre columnas**: Ajusta la separación horizontal entre la columna de contenido y la de número de página (por defecto 150).
69-
4. **Idioma en Inglés**: Marca esta casilla si quieres que los encabezados aparezcan como `Content` y `Sheet` en vez de `Contenido` y `Hoja`.
70-
5. **Guardar en archivo nuevo (no sobrescribir)**: Si se marca, al generar el índice te preguntará dónde guardarlo. De lo contrario, usará (y sobrescribirá) el archivo `indice_generado.sch`.
71-
6. **Añadir Página**: Abre un cuadro de diálogo para añadir una nueva entrada (nombre de página y número de hoja).
72-
7. **Generar Índice**: Crea el índice con las entradas listadas, lo guarda en el archivo elegido y copia el texto al portapapeles.
73-
8. **Cargar Archivo**: Permite abrir un `.sch` previamente generado y recuperar sus páginas para editarlas de nuevo.
74-
9. **Ajustar Tamaño de Textos**: Abre una ventana donde puedes cambiar el tamaño de la fuente para el título, versión, encabezados y páginas.
65+
1. **Project Name**: Fill in the field with the name you want to display in the index.
66+
2. **Version**: Enter the version (e.g., `v2.3`).
67+
3. **Column Spacing**: Adjust the horizontal spacing between the content column and the page number column (default is 110).
68+
4. **Language in English**: Check this box if you want the headers to appear as `Content` and `Sheet` instead of `Contenido` and `Hoja`.
69+
5. **Save in new file (don't overwrite)**: If checked, the application will ask where to save the index each time. Otherwise, it will use (and overwrite) the file `indice_generado.sch`.
70+
6. **Add Page**: Opens a dialog to add a new entry (page name and sheet number).
71+
7. **Generate Index**: Creates the index with the listed entries, saves it to the selected file, and copies the text to the clipboard.
72+
8. **Load File**: Allows you to open a previously generated `.sch` file and retrieve its pages for editing.
73+
9. **Adjust Text Sizes**: Opens a window where you can change the font size for the title, version, headers, and pages.
7574

76-
## Archivo de configuración `config.ini`
75+
## `config.ini` Configuration File
7776

78-
El archivo `config.ini` contiene los valores por defecto para la aplicación. Por ejemplo:
77+
The `config.ini` file contains the default values for the application. For example:
7978

8079
```ini
8180
[DEFAULTS]
@@ -84,27 +83,18 @@ font_size_version = 10
8483
font_size_header = 5
8584
font_size_page = 4
8685
default_spacing = 150
87-
default_language = es
86+
default_language = en
8887
save_in_new_file = false
8988
```
9089

91-
- `font_size_title` / `font_size_version` / `font_size_header` / `font_size_page`: Tamaños de fuente por defecto.
92-
- `default_spacing`: Distancia entre columnas por defecto.
93-
- `default_language`: `es` para español o `en` para inglés.
94-
- `save_in_new_file`: `true` para que, por defecto, se guarde siempre en un archivo nuevo; `false` para sobrescribir.
90+
- `font_size_title` / `font_size_version` / `font_size_header` / `font_size_page`: Default font sizes.
91+
- `default_spacing`: Default column spacing.
92+
- `default_language`: `es` for Spanish or `en` for English.
93+
- `save_in_new_file`: `true` to always save in a new file by default; `false` to overwrite.
9594

96-
Puedes editar estos valores sin necesidad de modificar el código Python. La próxima vez que ejecutes la aplicación, tomará en cuenta los cambios del `config.ini`.
95+
You can edit these values without modifying the Python code. The next time you run the application, it will apply the changes from `config.ini`.
9796

9897
>[!TIP]
99-
> Para ejecutarlo en segundo plano
98+
> To run it in the background without showing errors:
10099
>
101-
>`nohup python3 /ruta/kicad_index_creator.py > /dev/null 2>&1 &`
102-
103-
## Contribución
104-
105-
Si deseas contribuir a este proyecto, puedes:
106-
107-
- **Crear un fork** de este repositorio y enviar tus mejoras mediante pull requests.
108-
- **Reportar problemas** o sugerir nuevas funcionalidades en la sección de [Issues](../../issues).
109-
110-
¡Toda ayuda es bienvenida!
100+
>`nohup python3 /path/kicad_index_creator.py > /dev/null 2>&1 &`
File renamed without changes.

0 commit comments

Comments
 (0)