Skip to content

Commit 44f29b6

Browse files
committed
Merge pull request #93 from d-Rickyy-b/rebuild
Huge rebuild of the whole code
2 parents fe34382 + 5c66529 commit 44f29b6

File tree

89 files changed

+3264
-1975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3264
-1975
lines changed

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
language: python
22
sudo: require
33
python:
4-
- "3.4"
54
- "3.6"
5+
- "3.7"
6+
- "3.8"
67
# command to install dependencies
78
install:
8-
- pip install python-telegram-bot --upgrade
9+
- pip install -r requirements.txt
10+
- pip install coveralls
911

1012
# command to run tests
1113
script:
12-
- pwd
1314
- python -m compileall ./
15+
- coverage run --omit='*/virtualenv/*,*/site-packages/*,*/tests/*' -m unittest discover -s . -v -p "*_test.py"
1416

15-
# pychecker doesn't work as expected for me. Until now i'm going with just syntax checking all the files.
16-
# - pychecker ./*.py
17+
# create coverage for one python version
18+
after_success:
19+
- test $TRAVIS_PYTHON_VERSION == "3.8" && coveralls
1720

1821
notifications:
1922
email: false

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
[![Build Status](https://travis-ci.org/d-Rickyy-b/Python-BlackJackBot.svg?branch=master)](https://travis-ci.org/d-Rickyy-b/Python-BlackJackBot) [![Code Health](https://landscape.io/github/d-Rickyy-b/Python-BlackJackBot/master/landscape.svg?style=flat)](https://landscape.io/github/d-Rickyy-b/Python-BlackJackBot/master)
1+
[![Build Status](https://travis-ci.com/d-Rickyy-b/Python-BlackJackBot.svg?branch=master)](https://travis-ci.com/d-Rickyy-b/Python-BlackJackBot)
2+
[![Coverage Status](https://coveralls.io/repos/github/d-Rickyy-b/Python-BlackJackBot/badge.svg?branch=rebuild)](https://coveralls.io/github/d-Rickyy-b/Python-BlackJackBot?branch=rebuild)
3+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/12996d68fc0f436085221ac6b1f525f9)](https://www.codacy.com/manual/d-Rickyy-b/Python-BlackJackBot?utm_source=github.com&utm_medium=referral&utm_content=d-Rickyy-b/Python-BlackJackBot&utm_campaign=Badge_Grade)
24

35
# Python-BlackJackBot
46

57
This is the code for my Telegram Bot with which you can play the game Black Jack. You can find it here: https://telegram.me/BlackJackBot
68

7-
The main file, which needs to be executed is 'main.py'.
8-
You need to put your API-Token in the right place in the main file.
9+
The main file, which needs to be executed is 'main.py'. Please create a copy of the config.sample.py, name it config.py and enter the config data (e.g. bot
10+
token).
911

10-
## Other Software
12+
## Setup
1113

1214
The bot uses the [python-telegram-bot](https://python-telegram-bot.org/) framework to make Telegram API calls. You can install it like that:
1315

14-
``pip install python-telegram-bot``
16+
``pip install -r requirements.txt``
1517

1618
## Database
1719

18-
The bot uses a SQLite database. The database file is in the "database" directory. It is called 'users.db'. The database gets auto-generated, if it doesn't exist. Make sure the program has write access to the database directory.
20+
The bot uses a SQLite database. The database file is in the "database" directory. It is called 'users.db'. The database gets auto-generated, if it doesn't exist. Make sure the program has write access to the database directory.

blackjack/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# -*- coding: utf-8 -*-

blackjack/errors/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from .playerbustedexception import PlayerBustedException
4+
from .gamealreadyrunningexception import GameAlreadyRunningException
5+
from .playeralreadyexistingexception import PlayerAlreadyExistingException
6+
from .gamenotrunningexception import GameNotRunningException
7+
from .maxplayersreachedexception import MaxPlayersReachedException
8+
from .notenoughplayersexception import NotEnoughPlayersException
9+
from .nextplayerisdealerexception import NextPlayerIsDealerException
10+
from .insufficientpermissionsexception import InsufficientPermissionsException
11+
from .noplayersleftexception import NoPlayersLeftException
12+
from .playergot21exception import PlayerGot21Exception
13+
14+
__all__ = ['PlayerBustedException', 'GameAlreadyRunningException', 'PlayerAlreadyExistingException', 'MaxPlayersReachedException', 'GameNotRunningException',
15+
'NotEnoughPlayersException', 'NextPlayerIsDealerException', 'InsufficientPermissionsException', 'NoPlayersLeftException', 'PlayerGot21Exception']
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
3+
4+
class GameAlreadyRunningException(Exception):
5+
pass
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
3+
4+
class GameNotRunningException(Exception):
5+
pass
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
3+
4+
class InsufficientPermissionsException(Exception):
5+
pass
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
3+
4+
class MaxPlayersReachedException(Exception):
5+
pass
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
3+
4+
class NextPlayerIsDealerException(Exception):
5+
pass
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
3+
4+
class NoPlayersLeftException(Exception):
5+
pass

0 commit comments

Comments
 (0)