-
Notifications
You must be signed in to change notification settings - Fork 17
PR to solve the issue of messages mixing #53
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
Open
HashirGJ8842
wants to merge
43
commits into
Haider8:master
Choose a base branch
from
HashirGJ8842:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
ecf0b84
Update db.py
HashirGJ8842 2b4fc33
Update db.py
HashirGJ8842 c01ddfe
'new' variable to create databases for new users
HashirGJ8842 65b1fc6
Update db.py
HashirGJ8842 7f2e80b
Update db.py
HashirGJ8842 e486493
Update db.py
HashirGJ8842 909f3a5
Update requirements.txt
HashirGJ8842 68f1dd5
Update db.py
HashirGJ8842 98e7b29
Update db.py
HashirGJ8842 40528e1
Update cli.py
HashirGJ8842 33dc6e2
Update db.py
HashirGJ8842 65a4a1e
Update cli.py
HashirGJ8842 cf9cbed
Update requirements.txt
HashirGJ8842 0c9c00c
Update db.py
HashirGJ8842 009cf89
Update db.py
HashirGJ8842 e67459b
Update requirements.txt
HashirGJ8842 0166b7c
Update requirements.txt
HashirGJ8842 7c468e9
Update requirements.txt
HashirGJ8842 c39ab5c
Update .travis.yml
HashirGJ8842 b901b95
Update .travis.yml
HashirGJ8842 3e0abc6
Update .travis.yml
HashirGJ8842 72b58f6
Update .travis.yml
HashirGJ8842 92efb10
Update .travis.yml
HashirGJ8842 cc36051
Update .travis.yml
HashirGJ8842 b884ce8
Update .travis.yml
HashirGJ8842 6931784
Update requirements.txt
HashirGJ8842 b7311b9
Update requirements.txt
HashirGJ8842 ce5bea9
Update .travis.yml
HashirGJ8842 5616731
Update .travis.yml
HashirGJ8842 2f55181
Update db.py
HashirGJ8842 4406ae4
Update auth.py
HashirGJ8842 b1bc6a1
Update .travis.yml
HashirGJ8842 d622585
Update db.py
HashirGJ8842 0701dfb
Update requirements.txt
HashirGJ8842 366b3e1
Update db.py
HashirGJ8842 8935f70
Update requirements.txt
HashirGJ8842 14c401c
Update requirements.txt
HashirGJ8842 8393997
Update db.py
HashirGJ8842 badbe2a
Update cli.py
HashirGJ8842 e113d4e
Update db.py
HashirGJ8842 4686635
Update db.py
HashirGJ8842 9b3692d
Update db.py
HashirGJ8842 30960f9
Update cli.py
HashirGJ8842 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -4,25 +4,22 @@ | |
| from peewee import CharField, DateTimeField, Model, SqliteDatabase | ||
|
|
||
|
|
||
| MESSAGES_DB = SqliteDatabase('message_store.sqlite') | ||
| def database(user, raw_msg, new): | ||
| """user for sender, raw_msg for message, new if the user is new""" | ||
| MESSAGES_DB = SqliteDatabase(f'{user}.db')# pylint: disable=invalid-name | ||
|
|
||
|
|
||
| class Message(Model): | ||
| """Message table - keeps track of message sent and received""" | ||
| sender = CharField() | ||
| message = CharField() | ||
| timestamp = DateTimeField() | ||
| class Message(Model): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. too many blank lines (2) |
||
| """Message table - keeps track of message sent and received""" | ||
| sender = CharField() | ||
| message = CharField() | ||
| timestamp = DateTimeField() | ||
|
|
||
| class Meta: # pylint: disable=missing-class-docstring,too-few-public-methods | ||
| database = MESSAGES_DB | ||
| class Meta: # pylint: disable=missing-class-docstring,too-few-public-methods | ||
| database = MESSAGES_DB | ||
|
|
||
|
|
||
| @MESSAGES_DB | ||
| def store_messages(user, raw_msg): | ||
| """Store a message sent by the indicated user in the database""" | ||
| if new == True: # pylint: disable=singleton-comparison | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at least two spaces before inline comment |
||
| MESSAGES_DB.create_tables([Message]) | ||
| time = datetime.now() | ||
|
|
||
| Message.create(sender=user, message=raw_msg, timestamp=time) | ||
|
|
||
|
|
||
| MESSAGES_DB.create_tables([Message]) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least two spaces before inline comment