You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-22Lines changed: 40 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,22 @@
4
4
5
5
**Molly** is an open source package for python helping handling with the booking process of CDUT Library's study.
6
6
7
-
This branch is for python *3.7+*, If you are seeking for previous support for python 2.7+, please check out branch *v1.0+*.
7
+
This branch is for python *3.7+*, If you are seeking for previous support for python 2.7+, please check out branch *v1.0+*, which still works but will not be maintained continuously.
8
8
9
9
## Installation
10
10
11
11
First, install all the dependencies that are required for this package.
@@ -39,7 +39,7 @@ Create a file named **credits.json** besides dinner.py with your login credentia
39
39
}
40
40
```
41
41
42
-
### dinner.py customizations
42
+
### dinner.py customization
43
43
44
44
If you would like to use dinner directly in the terminal, simply navigate to the folder and import dinner, dinner.py will initialize itself automatically and then you are free to use all the methods.
45
45
@@ -49,15 +49,18 @@ Otherwise, you may need to set `standbyMode` to `True` if you are using it in sc
49
49
50
50
### dinner.py api cheatsheet
51
51
52
+
This file contains quite a lot of methods that you may need for your application. Discover high-level usages yourself.
53
+
52
54
#### init()
53
55
54
-
Initialize the library, including checking connection to the system, loading room information from file and so on.
56
+
Initialize the library, including checking the connection to the system interface, loading room information, login credits from file and so on.
55
57
56
58
|Parameter|Type|Default|Example|Detail|
57
59
|-|-|-|-|-|
58
60
|`ignoreConnectionFault`|bool|False|True|wether exit on connection failure|
61
+
|`dynamicLoginCredits`|dict|None|{"user": 201906010101, "passwd": "010101"}|making the appplication more flexible|
59
62
60
-
Notice that if `standbyMode` is set to `True`, the script will not exit just as `ignoreConectionFault = True`will do.
63
+
Notice that if `standbyMode` is set to `True`, the script will not exit just as `ignoreConectionFault = True`does.
61
64
62
65
|Return value|Type|Detail|
63
66
|-|-|-|
@@ -173,9 +176,9 @@ Renew the room which is currently used for further 2 hours if not occupied by ot
173
176
174
177
|Parameter|Type|Default|Example|Detail|
175
178
|-|-|-|-|-|
176
-
|`bookingId`|int|`None`|393487|could be obtained using `getMyBookingInfo()`|
179
+
|`bookingId`|int|`None`|393487|could be obtained using `getUserBookingInfo()`|
177
180
178
-
Cancel a room with the specific `bookingId` which could be got by using `getMyBookingInfo()` funcion.
181
+
Cancel a room with the specific `bookingId` which could be got by using `getUserBookingInfo()` funcion.
179
182
Return `True` if successful, or error message if failed.
180
183
181
184
|Return value|Type|Detail|
@@ -185,7 +188,7 @@ Return `True` if successful, or error message if failed.
185
188
|`Exception_ConnectionTimeOut`|str|connection to remote server could not be established|
186
189
|`<errorMessage>`|str|details of the failure|
187
190
188
-
#### getMyBookingInfo(prettified = False)
191
+
#### getUserBookingInfo(prettified = False)
189
192
190
193
|Parameter|Type|Default|Example|Detail|
191
194
|-|-|-|-|-|
@@ -194,7 +197,7 @@ Return `True` if successful, or error message if failed.
194
197
Refresh the cookie and make the query, then return the booking information of the current user.
195
198
Set parameter `prettified` to `True` to use terminal-tables which makes it easier to check the information returnded.
196
199
197
-
Notice that once you have signed up at the entrance of the study or the time(20 minutes) has passed without your signing-up, the entry will disappear from there. So you may have to use `getMyBookingHistory()` instead.
200
+
Notice that once you have signed up at the entrance of the study or the time(20 minutes) has passed without your signing-up, the entry will disappear from there. So you may have to use `getUserBookingHistory()` instead.
198
201
199
202
|Return value|Type|Detail|
200
203
|-|-|-|
@@ -203,7 +206,7 @@ Notice that once you have signed up at the entrance of the study or the time(20
203
206
|`Exception_ConnectionTimeOut`|str|connection to remote server could not be established|
204
207
|`Exception_DataStreamBroken`|str|process interrupted when handling data, retrying may help mostly|
205
208
206
-
#### getMyBookingHistory()
209
+
#### getUserBookingHistory()
207
210
208
211
|Parameter|Type|Default|Example|Detail|
209
212
|-|-|-|-|-|
@@ -217,7 +220,7 @@ Notice that once you have signed up at the entrance of the study or the time(20
217
220
|`Exception_ConnectionTimeOut`|str|connection to remote server could not be established|
218
221
|`Exception_DataStreamBroken`|str|process interrupted when handling data, retrying may help mostly|
219
222
220
-
### cafe.py automaticbooking configurations
223
+
### cafe.py: automatic-booking helper
221
224
222
225
Creat a new file named **recipe.json**, where you are free to present your booking tasks to cafe.py like this below:
223
226
@@ -248,17 +251,18 @@ Creat a new file named **recipe.json**, where you are free to present your booki
Notice: according to the license, you are required to make appropriate contributions to this project in case you run it. Check out [Toay's pre-mit license](https://toay.org/projects/pre-mit-license) for more information.
284
+
2020/03/16, this repo is turned public.
275
285
276
-
You can make contributions to this project in the following ways.
286
+
According to the license, you are expected to make appropriate contributions to this project in case you make use of it.
277
287
288
+
You can make contributions to this project in various ways.
289
+
290
+
* help with those listed in Todos
278
291
* complete the library file **dinner.py** by add functions or making optimizations
279
-
* complete the application file **cafe.py**
280
-
* making your application using library **dinner.py** and publish your project using the same license
292
+
* build your great application using library **dinner.py** and publish your project using the same license
293
+
294
+
Check out [Toay's pre-mit license](https://toay.org/projects/pre-mit-license) for more information.
295
+
296
+
### Todos
297
+
298
+
* package the project up using pypi standard and publish
281
299
282
300
## This and that
283
301
284
-
Thisn project is maintained by twikor at**[Toay laboratory](https://toay.org)**, a place where we enjoy making creative things. We hope the ones who think of themselves useful to a newly-founded non-profit studio for creators not to hesitate joining us.
302
+
This project is maintained by twikor @**[Toay laboratory](https://toay.org)**, a place where we enjoy making creative things. We hope the ones who think of themselves useful to a newly-founded non-profit studio for creators not to hesitate joining us.
285
303
286
-
For more information, please have a look at **[this](https://toay.org/about/signing-up)**.
304
+
For more information, please have a look at **[this](https://toay.org/about/signing-up)**.
0 commit comments