Skip to content

Commit 7b87794

Browse files
authored
Merge pull request #109 from andresdelfino/use_names_for_difficulty_levels
Use names when showing difficulty levels
2 parents d57898b + 73c4fd0 commit 7b87794

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/pycamp_bot/commands/projects.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
CHECK_GRUPO = "check_grupo"
2222
GRUPO = "grupo"
2323

24+
DIFFICULTY_LEVEL_NAMES = {
25+
1: 'inicial',
26+
2: 'intermedio',
27+
3: 'avanzado',
28+
}
29+
2430
REPO_EXISTS_PATTERN = 'repoexists'
2531
PROJECT_NAME_PATTERN = 'projectname'
2632
GROUP_EXISTS_PATTERN = 'groupexists'
@@ -78,9 +84,9 @@ async def naming_project(update, context):
7884
text=textwrap.dedent("""
7985
¿Cuál es el nivel de dificultad del proyecto?
8086
81-
1: newbie friendly
82-
2: intermedio
83-
3: python avanzado"""
87+
1: {DIFFICULTY_LEVEL_NAMES[1]}
88+
2: {DIFFICULTY_LEVEL_NAMES[2]}
89+
3: {DIFFICULTY_LEVEL_NAMES[3]}"""
8490
)
8591
)
8692
return DIFICULTAD
@@ -446,7 +452,7 @@ async def show_projects(update, context):
446452
project.name,
447453
project.owner.username,
448454
project.topic,
449-
project.difficult_level,
455+
DIFFICULTY_LEVEL_NAMES[project.difficult_level]
450456
project.repository_url or '(ninguno)',
451457
project.group_url or '(ninguno)',
452458
)

0 commit comments

Comments
 (0)