-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganiza fuentes en packages para invocar querier desde gui y consola
- Loading branch information
Showing
9 changed files
with
104 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from gui.App import App | ||
|
||
if __name__ == "__main__": | ||
app = App() | ||
app.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__all__ = ["querier"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf8 | ||
|
||
import yaml | ||
import logging | ||
import logging.config | ||
import traceback | ||
from repos import * | ||
|
||
|
||
def read_yaml(file_path): | ||
with open(file_path, "r") as f: | ||
return yaml.safe_load(f) | ||
|
||
|
||
def querier(debug: bool, query: str = "", content: str = "", from_year: str = "", | ||
to_year: str = "", title: str = "", abstract: str = "", redirect_logs = False): | ||
print("Cargando archivo de configuración") | ||
cfg = read_yaml("config/querier_config.yml") # TODO: Pendiente hacer chequeo de errores | ||
|
||
if debug: | ||
print("El debug esta habilitado") | ||
|
||
print("Cargando clases de repositorios") | ||
for repo in cfg['repos'].keys(): | ||
try: | ||
# La línea siguiente invoca a la clase dentro del package. | ||
# Ejemplo: invoca al constructor ieee() de repos.ieee_def | ||
if cfg['repos'][repo]['enabled'] is True: | ||
id = getattr(globals()[repo + '_def'], repo)(cfg['repos'][repo], cfg['params'], debug) | ||
if id is not None: | ||
id.say_hello() | ||
if query == "" or query is None: | ||
id.add_query_param(content, 'content') | ||
id.add_query_param(from_year, 'from_year') | ||
id.add_query_param(title, 'title') | ||
id.add_query_param(to_year, 'to_year') | ||
id.add_query_param(abstract, 'abstract') | ||
else: | ||
id.load_query(args.query) | ||
id.search() | ||
del id | ||
except Exception: | ||
traceback.print_exc() | ||
print("Fin de ejecución") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__all__ = ["App.py", "history_page", "indexer_page", "log_frame", "misc", "querier_page"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dee352a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parece que pasó un huracan por este commit, ja! Todo cambio de lugar, parece que llevó bastante trabajo al final reacomodar el proyecto.
Luego me lo voy a bajar para ejecutar y ver que todo sigue funcionando en mi ambiente.
Avanti @JCMiguel !