Skip to content

Commit aaab55d

Browse files
committed
Formateo a archivos de proyecto
1 parent 885417b commit aaab55d

File tree

16 files changed

+78
-92
lines changed

16 files changed

+78
-92
lines changed

bin/pycamp_manager.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import argparse
22
import datetime
33
import logging
4-
54
from pycamp_bot.models import Pycamp
65
from pycamp_bot.models import Pycampista
76
from pycamp_bot.models import PycampistaAtPycamp
8-
97
from pycamp_bot.models import models_db_connection
108

119

bin/run_bot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from pycamp_bot.commands import raffle
1111
from pycamp_bot.commands import schedule
1212
from pycamp_bot.commands import announcements
13-
1413
from pycamp_bot.models import models_db_connection
1514

1615

setup.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
from setuptools import find_packages
44
from setuptools import setup
55

6-
setup( name='PyCamp_Bot',
7-
version='3.0',
8-
description='Bot de telegram para organizar pycamp',
9-
author='Pyar',
10-
author_email='[email protected]',
11-
packages=find_packages('src'),
12-
package_dir={'': 'src'},
13-
install_requires=[
14-
'munch==2.1.1',
15-
'python-telegram-bot==10.0.2',
16-
'peewee',
17-
],
18-
test_suite='tests'
19-
)
20-
6+
setup(
7+
name='PyCamp_Bot',
8+
version='3.0',
9+
description='Bot de telegram para organizar pycamp',
10+
author='Pyar',
11+
author_email='[email protected]',
12+
packages=find_packages('src'),
13+
package_dir={'': 'src'},
14+
install_requires=[
15+
'munch==2.1.1',
16+
'python-telegram-bot==10.0.2',
17+
'peewee',
18+
],
19+
test_suite='tests'
20+
)

src/pycamp_bot/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from pycamp_bot import db_schemma
2-
from pycamp_bot import models
3-
from pycamp_bot import commands
1+
from pycamp_bot import db_schemma # noqa: F401
2+
from pycamp_bot import models # noqa: F401
3+
from pycamp_bot import commands # noqa: F401
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
11
import logging
2-
import os
3-
42
from telegram.ext import CommandHandler
53
from pycamp_bot.models import Project, Pycampista, Vote
64
from pycamp_bot.commands.auth import get_admins_username
75

86

97
logger = logging.getLogger(__name__)
8+
9+
1010
def announce(bot, update):
1111
username = update.message.from_user.username
1212
admins = get_admins_username()
1313
project_name = update.message.text.split()[1:]
14-
15-
project_name = " ".join(project_name)
16-
project = Project.select().where(Project.name ==project_name)
1714

15+
project_name = " ".join(project_name)
16+
project = Project.select().where(Project.name == project_name)
1817

1918
if len(project) <= 0:
2019
bot.send_message(
21-
chat_id=update.message.chat_id,
22-
text=f"El proyecto '{project_name}' no existe o esta mal escroto.\n"
20+
chat_id=update.message.chat_id,
21+
text=f"El proyecto '{project_name}' no existe o esta mal escroto.\n"
2322
"El formato de este comando es:\n"
2423
"/anunciar NOMBRE_DEL_PROYECTO"
2524
)
2625
return
2726

2827
if not (project.get().owner.username == username or username in admins):
2928
bot.send_message(
30-
chat_id=update.message.chat_id,
31-
text=f"No sos ni admin ni el owner de este proyecto, Careta."
32-
)
29+
chat_id=update.message.chat_id,
30+
text="No sos ni admin ni el owner de este proyecto, Careta."
31+
)
3332
return
3433

35-
3634
pycampistas = Vote.select().join(Pycampista).where((Vote.project == project) & (Vote.interest))
3735

3836
chat_id_list = [user.pycampista.chat_id for user in pycampistas]
39-
37+
4038
for chat_id in chat_id_list:
4139
bot.send_message(
4240
chat_id=chat_id,
4341
text=f"Esta por empezar {project_name} a cargo de @{project.get().owner.username}."
4442
)
4543
bot.send_message(
4644
chat_id=update.message.chat_id,
47-
text=f"Anunciado!"
45+
text="Anunciado!"
4846
)
4947

48+
5049
def set_handlers(updater):
5150
updater.dispatcher.add_handler(CommandHandler('anunciar', announce))
52-

src/pycamp_bot/commands/auth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import os
3-
43
from telegram.ext import CommandHandler
54
from pycamp_bot.models import Pycampista
65

src/pycamp_bot/commands/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import logging
2-
32
from telegram.ext import CommandHandler
4-
53
from pycamp_bot.commands.help_msg import get_help
64

75

src/pycamp_bot/commands/manage_pycamp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import datetime
22
import logging
3-
43
from telegram.ext import CommandHandler
5-
64
from pycamp_bot.models import Pycamp
75
from pycamp_bot.models import Pycampista
86
from pycamp_bot.models import PycampistaAtPycamp

src/pycamp_bot/commands/projects.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import logging
2-
from telegram.ext import (ConversationHandler, CommandHandler,
3-
MessageHandler, Filters)
4-
2+
from telegram.ext import (ConversationHandler, CommandHandler, MessageHandler, Filters)
53
from pycamp_bot.models import Pycampista, Project, Vote
64
from pycamp_bot.commands.base import msg_to_active_pycamp_chat
75
from pycamp_bot.commands.manage_pycamp import active_needed, get_active_pycamp
@@ -195,7 +193,8 @@ def show_projects(bot, update):
195193
project.topic,
196194
project.difficult_level
197195
)
198-
participants_count = Vote.select().where((Vote.project == project) & (Vote.interest)).count()
196+
participants_count = Vote.select().where((Vote.project == project)
197+
& (Vote.interest)).count()
199198
if participants_count > 0:
200199
project_text += "\n Interesades: {}".format(participants_count)
201200
text.append(project_text)

src/pycamp_bot/commands/raffle.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import random
2-
32
from telegram.ext import CommandHandler
4-
53
from pycamp_bot.models import Pycampista
64
from pycamp_bot.commands.auth import admin_needed
75

0 commit comments

Comments
 (0)