Skip to content
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

Ivander-Change RC4Space to Orcatech #1

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1cbd11c
Add python CI
ivanderjmw Nov 17, 2020
76c6e42
Update gitignore
ivanderjmw Nov 17, 2020
d607df9
Use python-telegram-bot v12.8
ivanderjmw Nov 18, 2020
438a000
Checkstyle with flake8
ivanderjmw Nov 18, 2020
1f9a4d5
Change to available python version
ivanderjmw Nov 18, 2020
67a335a
Merge pull request #1 from ivanderjmw/virtual-env
ivanderjmw Nov 18, 2020
06d1926
Create runtime.txt
ivanderjmw Nov 18, 2020
7a1f9fb
Remove telegram
ivanderjmw Nov 18, 2020
83ffc78
Merge pull request #2 from ivanderjmw/requirements
ivanderjmw Nov 18, 2020
3b8ee6f
Update requirements.txt
ivanderjmw Nov 18, 2020
e41cbae
Change to Orcatech
ivanderjmw Nov 18, 2020
e67e3cb
Merge pull request #6 from OrcaTech-RC4/Ivander
ivanderjmw Nov 18, 2020
a2b2b8c
Add remaining time to the shown status
LazyYuuki Nov 28, 2020
add85f8
Update requirements.txt
timotius-jason Dec 8, 2020
148cc5b
Add and use mock data
ivanderjmw Dec 16, 2020
738bf09
Added sheets.py
timotius-jason Dec 16, 2020
19788df
Revert "Added sheets.py"
timotius-jason Dec 16, 2020
7878aa4
Merge pull request #8 from OrcaTech-RC4/Ivander
ivanderjmw Dec 16, 2020
cddd215
Added the reporting feature (uncomplete)
timotius-jason Dec 17, 2020
52e5887
Added the reporting feature
timotius-jason Dec 18, 2020
fbb1f42
Make counting down time dynamic, repsonsive
LazyYuuki Dec 18, 2020
9c27d21
Remove "cross" state
LazyYuuki Dec 18, 2020
20b662b
Removed token.pickle
timotius-jason Dec 18, 2020
e7f2909
Add documentation, and reminder button
LazyYuuki Dec 18, 2020
e299261
Finish front end of reminder function
LazyYuuki Dec 18, 2020
d0ce1fa
Finish add_reminder ()
LazyYuuki Dec 19, 2020
d8edd85
erased credentials
LazyYuuki Dec 19, 2020
31ce16c
Changed sheets range
timotius-jason Dec 19, 2020
7b8e9a5
Using csv for data storing
LazyYuuki Dec 19, 2020
e8841a3
Erased reminder
LazyYuuki Dec 19, 2020
90e1d70
Merge branch 'master' into Timo
ivanderjmw Dec 23, 2020
4eb6da7
Merge pull request #9 from OrcaTech-RC4/Timo
ivanderjmw Dec 23, 2020
c9c3b2c
Merge branch 'master' into Yuuki-CSV
ivanderjmw Jan 1, 2021
3ecddd3
Merge pull request #10 from OrcaTech-RC4/Yuuki-CSV
ivanderjmw Jan 1, 2021
e701e88
Changes to gitignore
ivanderjmw Jan 5, 2021
16d3a88
Merge branch 'master' into Ivander
ivanderjmw Jan 5, 2021
f9218e9
Refactor file structure
ivanderjmw Jan 5, 2021
0c7f97a
Create a polling system for reminders
ivanderjmw Jan 5, 2021
5bb91e3
Merge pull request #11 from OrcaTech-RC4/Ivander
ivanderjmw Jan 9, 2021
70f0fd6
Update requirements.txt
ivanderjmw Jan 9, 2021
be7fbe3
Update Procfile
ivanderjmw Jan 9, 2021
e5aaa93
Update sheets.py to cater directory change
ivanderjmw Jan 9, 2021
672cabc
Fix undeclared variable
ivanderjmw Jan 9, 2021
24656d3
Fix hardcode
ivanderjmw Jan 9, 2021
21bad17
Fix typo
ivanderjmw Jan 9, 2021
61d988e
Add config variables option for creds json
ivanderjmw Jan 9, 2021
cf6ea1c
Switch to run_console
ivanderjmw Jan 9, 2021
187a8df
fix outdated message bug
ivanderjmw Jan 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
exclude =
.git,
__pycache__,
docs/source/conf.py,
old,
build,
dist,
venv/*,

max-complexity = 10
33 changes: 33 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# native
token.pickle
reminder.csv
credentials.json

# virtual env
bin/
pyvenv.cfg

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -115,4 +124,4 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bot: python laundrybot.py
bot: python main/laundrybot.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NUSCollegeLaundryBot
Telegram BOT interface for the Laundry Machine Bot Project;
made with python-telegram-bot wrapper;
made for RC4 by RC4Space
made for RC4 by Orcatech(RC4Space)

# The Bot
## Interface
Expand Down
192 changes: 0 additions & 192 deletions laundrybot.py

This file was deleted.

File renamed without changes.
45 changes: 45 additions & 0 deletions main/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from datetime import datetime, timedelta

class MockData():
def getLevels(self):
return [5, 8, 11, 14, 17]

def getStatuses(self, level):
count = 4

machine_types = [
"washer-coin",
"washer-ezlink",
"dryer-ezlink",
"dryer-coin"
]
start_times = [
datetime.now() - timedelta(seconds=100),
datetime.now() - timedelta(seconds=200),
datetime.now() - timedelta(seconds=300),
datetime.now() - timedelta(seconds=400)
]
statuses = [0, 2, 1, 2]
machine_durations = [30, 30, 40, 40]

return [
{
"level": level,
"type": machine_types[i],
"start-time": start_times[i],
"status": statuses[i],
"time": datetime.now(),
"machine-duration": machine_durations[i]
} for i in range(0, count)
]

def charts(self):
chart = {"Mon": [], "Tue": [], "Wed": [], "Thu": [], "Fri": []}
n = 0

for day in chart:
chart[day] = [x**2 + n for x in range(0, 72)]
n += 1

return chart

Loading