forked from UsergeTeam/Userge
-
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.
add travis, deepsource and pep8speaks
- Loading branch information
Showing
5 changed files
with
83 additions
and
9 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,10 @@ | ||
version = 1 | ||
|
||
[[analyzers]] | ||
name = "python" | ||
enabled = true | ||
dependency_file_paths = ["requirements.txt"] | ||
|
||
[analyzers.meta] | ||
runtime_version = "3.x.x" | ||
max_line_length = 100 |
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,13 @@ | ||
# File : .pep8speaks.yml | ||
|
||
scanner: | ||
linter: flake8 | ||
|
||
flake8: | ||
max-line-length: 100 | ||
|
||
message: | ||
opened: | ||
header: "@{name}, Thanks for opening this PR." | ||
updated: | ||
header: "@{name}, Thanks for updating this PR." |
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,7 @@ | ||
language: python | ||
python: | ||
- "3.8" | ||
install: | ||
- pip install -r requirements.txt | ||
script: | ||
- python test.py |
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,40 @@ | ||
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >. | ||
# | ||
# This file is part of < https://github.com/UsergeTeam/Userge > project, | ||
# and is released under the "GNU v3.0 License Agreement". | ||
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE > | ||
# | ||
# All rights reserved. | ||
|
||
import os | ||
import asyncio | ||
from userge import userge | ||
|
||
async def worker(): | ||
chat_id = int(os.environ.get("CHAT_ID")) | ||
await userge.send_message(chat_id, 'testing_userge') | ||
print('sleeping 3 sec...!') | ||
await asyncio.sleep(3) | ||
|
||
async def main(): | ||
print('starting client...!') | ||
await userge.start() | ||
tasks = [] | ||
print('adding tasks...!') | ||
for task in userge._tasks: | ||
tasks.append(loop.create_task(task())) | ||
print('stating worker...!') | ||
await worker() | ||
print('closing tasks...!') | ||
for task in tasks: | ||
task.cancel() | ||
print('stopping client...!') | ||
await userge.stop() | ||
|
||
loop = asyncio.get_event_loop() | ||
print('creating loop...!') | ||
loop.run_until_complete(main()) | ||
print('closing loop...!') | ||
loop.close() | ||
|
||
print('userge test has been finished!') |