Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #48 - Mostrando arquivos contidos em grupos e pacotes #55

Merged
merged 7 commits into from
Aug 11, 2019

Conversation

itepifanio
Copy link
Member

Resolve #48

Copy link
Member

@nymarya nymarya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ficou faltando adicionar os testes dessas novas funções e na documentação também

@itepifanio itepifanio requested a review from nymarya August 9, 2019 12:52
Copy link
Member

@alvarofpp alvarofpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colocar as novas funções na doc geral.

@@ -90,3 +90,27 @@ print(list_groups)
# Output:
# ['pesquisa']
```

## print_files_from_group
Printa no terminal a lista de arquivos referentes ao grupo de entrada.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Printa" é uma palavra que não existe no português.

@@ -161,3 +161,29 @@ print(list_discentes)
# Output:
# ['dados-complementares-de-discentes', 'dados-socio-economicos-de-discentes', 'discentes']
```

## print_files_from_package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colocar em ordem alfabética.

def __init__(self):
self.url_base = 'http://dados.ufrn.br/'
self.url_action = self.url_base + 'api/action/'

def _print_exception(self, ex: Exception):
def _print_exception(self, ex: Exception,
msg: str = MSG_ERRORS['download_error']):
"""Imprime mensagem padrão para exceções."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mensagem não é padrão se você recebe ela como parâmetro. Existe a mensagem padrão, mas ela pode ser modificada.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não entendi isso, @alvarofpp, poderia elaborar melhor?
Antes tinha uma mensagem padrão, entretanto ela não fazia sentido pra minha utilização, só coloquei a mensagem padrão como global e deixei ela por default, podendo ser modificada posteriormente

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nem me lembro o que eu queria dizer aí.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mas me lembro de ter comentado pessoalmente com você que vc tem duas MSG_ERRORS, uma na classe Env e outra na classe Package. Seria interessante você colocar elas na classe Env, visto que Package herda dela, assim a variável fica em apenas um só lugar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho que queria que mudasse a nomenclatura no dosctring, já que existe uma mensagem padrão mas nem sempre ela é exibida

@@ -137,3 +137,8 @@ def search_related_groups(self, keyword: str,
)

return related

def print_files_from_group(self, name: str):
request = self._request_get(self.url_group + name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usa a variável que armazena grupos.

@@ -18,6 +18,8 @@ class Package(Env, FilterMixin):
instância da classe Tag usada na classe.
"""

MSG_ERRORS = {'none_package': 'Nenhum pacote foi encontrado'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seria melhor colocar essa variável na Env, visto que se usa em mais de uma classe.

def test_can_print_files_from_group(self):
"""Verifica se os arquivos de um grupo podem ser impresso na tela."""
assert_console(
lambda: self.ufrn_data.print_files_from_group('processos'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quebra o parenteses para facilitar saber onde termina.

def test_can_print_files_from_group_with_typo(self):
"""Verifica se o tratamento de erro com o Levenshtein funciona."""
assert_console(
lambda: self.ufrn_data.print_files_from_package('process'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mesma coisa da anterior.

Copy link
Member

@diegodiogenes diegodiogenes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolver o que foi levantado por Álvaro.

def __init__(self):
self.url_base = 'http://dados.ufrn.br/'
self.url_action = self.url_base + 'api/action/'

def _print_exception(self, ex: Exception):
def _print_exception(self, ex: Exception,
msg: str = MSG_ERRORS['download_error']):
"""Imprime mensagem padrão para exceções."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mas me lembro de ter comentado pessoalmente com você que vc tem duas MSG_ERRORS, uma na classe Env e outra na classe Package. Seria interessante você colocar elas na classe Env, visto que Package herda dela, assim a variável fica em apenas um só lugar.

…ões da documentação em ordem alfabética. Centraliza mensagens globais de erro na classe Env. Adiciona formatação textual da lista levenshtein para string. Quebra parenteses de linhas mal formatadas em testes
@alvarofpp alvarofpp merged commit 7b17e33 into master Aug 11, 2019
@alvarofpp alvarofpp deleted the issue-48 branch August 11, 2019 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adicionar método de listar arquivos em um package
4 participants