remindmail 1!1.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- remindmail-1!1.9.0/LICENSE.md +21 -0
- remindmail-1!1.9.0/PKG-INFO +189 -0
- remindmail-1!1.9.0/README.md +177 -0
- remindmail-1!1.9.0/pyproject.toml +6 -0
- remindmail-1!1.9.0/setup.cfg +34 -0
- remindmail-1!1.9.0/src/remind/__init__.py +0 -0
- remindmail-1!1.9.0/src/remind/__main__.py +134 -0
- remindmail-1!1.9.0/src/remind/error_handler.py +40 -0
- remindmail-1!1.9.0/src/remind/query_manager.py +306 -0
- remindmail-1!1.9.0/src/remind/reminder.py +292 -0
- remindmail-1!1.9.0/src/remind/reminder_confirmation.py +645 -0
- remindmail-1!1.9.0/src/remind/reminder_manager.py +475 -0
- remindmail-1!1.9.0/src/remindmail.egg-info/PKG-INFO +189 -0
- remindmail-1!1.9.0/src/remindmail.egg-info/SOURCES.txt +17 -0
- remindmail-1!1.9.0/src/remindmail.egg-info/dependency_links.txt +1 -0
- remindmail-1!1.9.0/src/remindmail.egg-info/entry_points.txt +2 -0
- remindmail-1!1.9.0/src/remindmail.egg-info/top_level.txt +1 -0
- remindmail-1!1.9.0/test/test.py +24 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Tyler Woodfin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: remindmail
|
|
3
|
+
Version: 1!1.9.0
|
|
4
|
+
Summary: Easily schedule reminders to be emailed
|
|
5
|
+
Home-page: https://github.com/tylerjwoodfin/remindmail
|
|
6
|
+
Author: Tyler Woodfin
|
|
7
|
+
Author-email: feedback-remindmail@tyler.cloud
|
|
8
|
+
License: : OSI Approved :: MIT License
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE.md
|
|
12
|
+
|
|
13
|
+
# RemindMail: Reminder Management Tool
|
|
14
|
+
Welcome to RemindMail, a powerful CLI tool designed to help you schedule and organize reminders efficiently. This utility leverages natural language for setting reminder times and includes functionalities to view, generate, and manage reminders directly from your terminal.
|
|
15
|
+
|
|
16
|
+
## features
|
|
17
|
+
RemindMail offers a variety of features to enhance your productivity:
|
|
18
|
+
|
|
19
|
+
- Easily manage your To Do list from anywhere in the terminal
|
|
20
|
+
- Schedule one-time or recurring reminders to your inbox
|
|
21
|
+
- Add notes or "for later" reminders
|
|
22
|
+
- View and manage upcoming reminders
|
|
23
|
+
|
|
24
|
+
# notable dependencies
|
|
25
|
+
|
|
26
|
+
- Linux (Raspberry Pis work great!)
|
|
27
|
+
- [cabinet](https://pypi.org/project/cabinet/)
|
|
28
|
+
- used to store JSON data; specifically, used to store the `remind.md` path and other important variables
|
|
29
|
+
- a unique, non-Gmail address specifically for this project
|
|
30
|
+
- do not use an email address that you use in other areas of your life
|
|
31
|
+
- do not re-use a password you've used anywhere else; use a unique password.
|
|
32
|
+
- Python3
|
|
33
|
+
|
|
34
|
+
# setup
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python3 -m pip install remindmail
|
|
38
|
+
|
|
39
|
+
# adjust path accordingly
|
|
40
|
+
pip install -r /path/to/requirements.md
|
|
41
|
+
|
|
42
|
+
cabinet config # cabinet must be configured properly
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## cabinet config
|
|
46
|
+
- you need to install and configure [cabinet](https://github.com/tylerjwoodfin/cabinet)
|
|
47
|
+
|
|
48
|
+
- initialize using `cabinet config`; see cabinet's README for details
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cabinet -p path remindmail file </path/to/remind.md>
|
|
52
|
+
cabinet -p email from <your unique and non-Gmail email address>
|
|
53
|
+
cabinet -p email from_name <your name (can be anything)>
|
|
54
|
+
cabinet -p from_pw <your email password>
|
|
55
|
+
cabinet -p email to <where reminder will send to>
|
|
56
|
+
cabinet -p email smtp_server <your SMTP server>
|
|
57
|
+
cabinet -p email port <your email port>
|
|
58
|
+
cabinet -p email imap_server <your IMAP server>
|
|
59
|
+
```
|
|
60
|
+
- note that Gmail will _not_ work due to their security restrictions.
|
|
61
|
+
- it's very bad practice to store your password in plaintext; for this reason, never sync this file.
|
|
62
|
+
- always use a unique email address specifically for this, and _especially_ use a unique password.
|
|
63
|
+
|
|
64
|
+
- example below:
|
|
65
|
+
```
|
|
66
|
+
{
|
|
67
|
+
"email": {
|
|
68
|
+
"from": "YourUniqueAndNonGmailEmailAddress",
|
|
69
|
+
"from_pw": "YourPassword",
|
|
70
|
+
"from_name": "Your Name",
|
|
71
|
+
"to": "RemindersSentToThisEmailAddress",
|
|
72
|
+
"smtp_server": "your domain's smtp server",
|
|
73
|
+
"imap_server": "your domain's imap server",
|
|
74
|
+
"port": 465
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## scheduling reminder checks
|
|
80
|
+
|
|
81
|
+
- type "crontab -e" in the terminal and add something like:
|
|
82
|
+
- `0 4 * * * remind --generate` (sends matching reminders at 4AM)
|
|
83
|
+
- `0 4 * * * remind --later` (sends emails scheduled for later)
|
|
84
|
+
|
|
85
|
+
- your setup may require `remind` to be replaced with something like:
|
|
86
|
+
- `0 4 * * * python3 /path/to/site-packages/remind/remind.py --generate`
|
|
87
|
+
|
|
88
|
+
- this function requires use of SMTP; please ensure you've configured this correctly.
|
|
89
|
+
|
|
90
|
+
# usage
|
|
91
|
+
|
|
92
|
+
- `remind`: Schedule a new reminder interactively
|
|
93
|
+
- `remind --title 'reminder title' --when 'june 20'`: Schedule a new reminder programatically
|
|
94
|
+
- `remind --title 'reminder title' --when '2024-06-20'`: Schedule a new reminder programatically
|
|
95
|
+
- `remind --title 'reminder title' --when 'every 3 weeks'`: Schedule a new reminder programatically
|
|
96
|
+
- `remind --title 'reminder title' --when 'friday'`: Schedule a new reminder programatically
|
|
97
|
+
- `remind --title 'reminder title' --when friday --save`: Schedule a new reminder programatically, saves without confirmation
|
|
98
|
+
- `remind --title 'reminder title' --when 'every 2 Mondays'`: Schedule a new reminder programatically
|
|
99
|
+
- `remind --title 'reminder title' --when 'now'`: Sends an email immediately
|
|
100
|
+
- `remind -h` (or `--help`): Displays usage information.
|
|
101
|
+
- `remind -g` (or `--generate`): Generates all reminders scheduled for today.
|
|
102
|
+
- I recommend setting up a crontab.
|
|
103
|
+
- `remind --later`: Emails reminders that are marked with `[later]`
|
|
104
|
+
- `remind --st` (or `--show-tomorrow`): Lists reminders in remind.md that target tomorrow's date
|
|
105
|
+
- `remind --sw` (or `--show-week`): Lists reminders for the next 7 days
|
|
106
|
+
- `remind -e` (or `--edit`): Opens `remind.md` in your configured editor
|
|
107
|
+
- `cabinet --config`: Configures [cabinet](https://pypi.org/project/cabinet/)
|
|
108
|
+
|
|
109
|
+
## using the TUI to confirm reminders
|
|
110
|
+
- unless `--save` is used, a confirmation will appear.
|
|
111
|
+
- use arrow keys (or `j` and `k` in VI Mode) to navigate.
|
|
112
|
+
- arrow left and right to iterate through:
|
|
113
|
+
- type
|
|
114
|
+
- value
|
|
115
|
+
- frequency
|
|
116
|
+
- offset
|
|
117
|
+
|
|
118
|
+
### VI Mode and Keybindings
|
|
119
|
+
- when the confirmation appears, use `j` or `k` to enter VI mode.
|
|
120
|
+
- `j` and `k` navigate up and down; `h` and `l` navigate left and right.
|
|
121
|
+
- use `i` to exit VI mode.
|
|
122
|
+
- use `q` to cancel the reminder.
|
|
123
|
+
|
|
124
|
+
## some notes about offset
|
|
125
|
+
|
|
126
|
+
- when scheduling a reminder, you can adjust the `offset` field to shift reminder schedules.
|
|
127
|
+
- For instance, one reminder may be "every 2 weeks", and the other can be every 2 weeks with an offset of 1, resulting in alternating reminders.
|
|
128
|
+
|
|
129
|
+
The offset is determined by the epoch date.
|
|
130
|
+
- The Epoch time is the number of seconds since January 1, 1970, UTC.
|
|
131
|
+
- For example, if the current time is 1619394350, then today is Sunday, April 25, 2021 at 11:45:50PM UTC.
|
|
132
|
+
- The "week number" is calculated by {epochTime}/60/60/24/7.
|
|
133
|
+
- 1619394350 /60/60/24/7 ~= 2677
|
|
134
|
+
- 2677 % 3 == 1, meaning scheduling a reminder for [W,3] would be sent last week, but not this week (or next week or the week after).
|
|
135
|
+
|
|
136
|
+
## remind.md
|
|
137
|
+
|
|
138
|
+
These are some examples of how your remind.md file will look.
|
|
139
|
+
|
|
140
|
+
## good examples
|
|
141
|
+
[w,1] Laundry
|
|
142
|
+
- this will send each week on Sunday.
|
|
143
|
+
|
|
144
|
+
[w,2] Sheets
|
|
145
|
+
- This will be sent every 2 weeks on Sunday.
|
|
146
|
+
|
|
147
|
+
[m,3] Review Budget
|
|
148
|
+
- This will be sent on the 1st of every 3 months.
|
|
149
|
+
|
|
150
|
+
[m,3,2] Change AC filter
|
|
151
|
+
- every 3 months, with an offset of 2
|
|
152
|
+
(see notes about Offset below)
|
|
153
|
+
|
|
154
|
+
[2024-05-03]d send report
|
|
155
|
+
- send on May 3
|
|
156
|
+
- This will be deleted after it's sent, as indicated by `]d`.
|
|
157
|
+
|
|
158
|
+
[09-20,1] Get a Flu Shot
|
|
159
|
+
This will be sent on September 20.
|
|
160
|
+
By the way, anything underneath a reminder tag is considered a note and will
|
|
161
|
+
be sent in the body of the email.
|
|
162
|
+
|
|
163
|
+
[dow,fri] Submit Timesheet
|
|
164
|
+
<b>Will be sent every Friday. Reminder notes support HTML.</b>
|
|
165
|
+
|
|
166
|
+
[dow,fri,2] Payday!
|
|
167
|
+
- This will send every other Friday.
|
|
168
|
+
|
|
169
|
+
[dow,thu,1]c ls > /home/tyler/directory.log
|
|
170
|
+
- Reminders ending with `]c` will be executed as commands, rather than
|
|
171
|
+
sent as emails.
|
|
172
|
+
|
|
173
|
+
[d,1] 40 Daily Pushups
|
|
174
|
+
This is sent each day.
|
|
175
|
+
|
|
176
|
+
[later] play diplomacy board game
|
|
177
|
+
This isn't sent, but it is saved for later and can be sent using
|
|
178
|
+
`remind --later`.
|
|
179
|
+
|
|
180
|
+
# Contributing
|
|
181
|
+
Contributions to RemindMail are welcome! Please feel free to fork the repository, make your changes, and submit a pull request.
|
|
182
|
+
|
|
183
|
+
# License
|
|
184
|
+
RemindMail is released under the MIT license. For more details, see the LICENSE file in the repository.
|
|
185
|
+
|
|
186
|
+
# Author Info
|
|
187
|
+
Tyler Woodfin
|
|
188
|
+
https://tyler.cloud
|
|
189
|
+
feedback-remindmail@tyler.cloud
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# RemindMail: Reminder Management Tool
|
|
2
|
+
Welcome to RemindMail, a powerful CLI tool designed to help you schedule and organize reminders efficiently. This utility leverages natural language for setting reminder times and includes functionalities to view, generate, and manage reminders directly from your terminal.
|
|
3
|
+
|
|
4
|
+
## features
|
|
5
|
+
RemindMail offers a variety of features to enhance your productivity:
|
|
6
|
+
|
|
7
|
+
- Easily manage your To Do list from anywhere in the terminal
|
|
8
|
+
- Schedule one-time or recurring reminders to your inbox
|
|
9
|
+
- Add notes or "for later" reminders
|
|
10
|
+
- View and manage upcoming reminders
|
|
11
|
+
|
|
12
|
+
# notable dependencies
|
|
13
|
+
|
|
14
|
+
- Linux (Raspberry Pis work great!)
|
|
15
|
+
- [cabinet](https://pypi.org/project/cabinet/)
|
|
16
|
+
- used to store JSON data; specifically, used to store the `remind.md` path and other important variables
|
|
17
|
+
- a unique, non-Gmail address specifically for this project
|
|
18
|
+
- do not use an email address that you use in other areas of your life
|
|
19
|
+
- do not re-use a password you've used anywhere else; use a unique password.
|
|
20
|
+
- Python3
|
|
21
|
+
|
|
22
|
+
# setup
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python3 -m pip install remindmail
|
|
26
|
+
|
|
27
|
+
# adjust path accordingly
|
|
28
|
+
pip install -r /path/to/requirements.md
|
|
29
|
+
|
|
30
|
+
cabinet config # cabinet must be configured properly
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## cabinet config
|
|
34
|
+
- you need to install and configure [cabinet](https://github.com/tylerjwoodfin/cabinet)
|
|
35
|
+
|
|
36
|
+
- initialize using `cabinet config`; see cabinet's README for details
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cabinet -p path remindmail file </path/to/remind.md>
|
|
40
|
+
cabinet -p email from <your unique and non-Gmail email address>
|
|
41
|
+
cabinet -p email from_name <your name (can be anything)>
|
|
42
|
+
cabinet -p from_pw <your email password>
|
|
43
|
+
cabinet -p email to <where reminder will send to>
|
|
44
|
+
cabinet -p email smtp_server <your SMTP server>
|
|
45
|
+
cabinet -p email port <your email port>
|
|
46
|
+
cabinet -p email imap_server <your IMAP server>
|
|
47
|
+
```
|
|
48
|
+
- note that Gmail will _not_ work due to their security restrictions.
|
|
49
|
+
- it's very bad practice to store your password in plaintext; for this reason, never sync this file.
|
|
50
|
+
- always use a unique email address specifically for this, and _especially_ use a unique password.
|
|
51
|
+
|
|
52
|
+
- example below:
|
|
53
|
+
```
|
|
54
|
+
{
|
|
55
|
+
"email": {
|
|
56
|
+
"from": "YourUniqueAndNonGmailEmailAddress",
|
|
57
|
+
"from_pw": "YourPassword",
|
|
58
|
+
"from_name": "Your Name",
|
|
59
|
+
"to": "RemindersSentToThisEmailAddress",
|
|
60
|
+
"smtp_server": "your domain's smtp server",
|
|
61
|
+
"imap_server": "your domain's imap server",
|
|
62
|
+
"port": 465
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## scheduling reminder checks
|
|
68
|
+
|
|
69
|
+
- type "crontab -e" in the terminal and add something like:
|
|
70
|
+
- `0 4 * * * remind --generate` (sends matching reminders at 4AM)
|
|
71
|
+
- `0 4 * * * remind --later` (sends emails scheduled for later)
|
|
72
|
+
|
|
73
|
+
- your setup may require `remind` to be replaced with something like:
|
|
74
|
+
- `0 4 * * * python3 /path/to/site-packages/remind/remind.py --generate`
|
|
75
|
+
|
|
76
|
+
- this function requires use of SMTP; please ensure you've configured this correctly.
|
|
77
|
+
|
|
78
|
+
# usage
|
|
79
|
+
|
|
80
|
+
- `remind`: Schedule a new reminder interactively
|
|
81
|
+
- `remind --title 'reminder title' --when 'june 20'`: Schedule a new reminder programatically
|
|
82
|
+
- `remind --title 'reminder title' --when '2024-06-20'`: Schedule a new reminder programatically
|
|
83
|
+
- `remind --title 'reminder title' --when 'every 3 weeks'`: Schedule a new reminder programatically
|
|
84
|
+
- `remind --title 'reminder title' --when 'friday'`: Schedule a new reminder programatically
|
|
85
|
+
- `remind --title 'reminder title' --when friday --save`: Schedule a new reminder programatically, saves without confirmation
|
|
86
|
+
- `remind --title 'reminder title' --when 'every 2 Mondays'`: Schedule a new reminder programatically
|
|
87
|
+
- `remind --title 'reminder title' --when 'now'`: Sends an email immediately
|
|
88
|
+
- `remind -h` (or `--help`): Displays usage information.
|
|
89
|
+
- `remind -g` (or `--generate`): Generates all reminders scheduled for today.
|
|
90
|
+
- I recommend setting up a crontab.
|
|
91
|
+
- `remind --later`: Emails reminders that are marked with `[later]`
|
|
92
|
+
- `remind --st` (or `--show-tomorrow`): Lists reminders in remind.md that target tomorrow's date
|
|
93
|
+
- `remind --sw` (or `--show-week`): Lists reminders for the next 7 days
|
|
94
|
+
- `remind -e` (or `--edit`): Opens `remind.md` in your configured editor
|
|
95
|
+
- `cabinet --config`: Configures [cabinet](https://pypi.org/project/cabinet/)
|
|
96
|
+
|
|
97
|
+
## using the TUI to confirm reminders
|
|
98
|
+
- unless `--save` is used, a confirmation will appear.
|
|
99
|
+
- use arrow keys (or `j` and `k` in VI Mode) to navigate.
|
|
100
|
+
- arrow left and right to iterate through:
|
|
101
|
+
- type
|
|
102
|
+
- value
|
|
103
|
+
- frequency
|
|
104
|
+
- offset
|
|
105
|
+
|
|
106
|
+
### VI Mode and Keybindings
|
|
107
|
+
- when the confirmation appears, use `j` or `k` to enter VI mode.
|
|
108
|
+
- `j` and `k` navigate up and down; `h` and `l` navigate left and right.
|
|
109
|
+
- use `i` to exit VI mode.
|
|
110
|
+
- use `q` to cancel the reminder.
|
|
111
|
+
|
|
112
|
+
## some notes about offset
|
|
113
|
+
|
|
114
|
+
- when scheduling a reminder, you can adjust the `offset` field to shift reminder schedules.
|
|
115
|
+
- For instance, one reminder may be "every 2 weeks", and the other can be every 2 weeks with an offset of 1, resulting in alternating reminders.
|
|
116
|
+
|
|
117
|
+
The offset is determined by the epoch date.
|
|
118
|
+
- The Epoch time is the number of seconds since January 1, 1970, UTC.
|
|
119
|
+
- For example, if the current time is 1619394350, then today is Sunday, April 25, 2021 at 11:45:50PM UTC.
|
|
120
|
+
- The "week number" is calculated by {epochTime}/60/60/24/7.
|
|
121
|
+
- 1619394350 /60/60/24/7 ~= 2677
|
|
122
|
+
- 2677 % 3 == 1, meaning scheduling a reminder for [W,3] would be sent last week, but not this week (or next week or the week after).
|
|
123
|
+
|
|
124
|
+
## remind.md
|
|
125
|
+
|
|
126
|
+
These are some examples of how your remind.md file will look.
|
|
127
|
+
|
|
128
|
+
## good examples
|
|
129
|
+
[w,1] Laundry
|
|
130
|
+
- this will send each week on Sunday.
|
|
131
|
+
|
|
132
|
+
[w,2] Sheets
|
|
133
|
+
- This will be sent every 2 weeks on Sunday.
|
|
134
|
+
|
|
135
|
+
[m,3] Review Budget
|
|
136
|
+
- This will be sent on the 1st of every 3 months.
|
|
137
|
+
|
|
138
|
+
[m,3,2] Change AC filter
|
|
139
|
+
- every 3 months, with an offset of 2
|
|
140
|
+
(see notes about Offset below)
|
|
141
|
+
|
|
142
|
+
[2024-05-03]d send report
|
|
143
|
+
- send on May 3
|
|
144
|
+
- This will be deleted after it's sent, as indicated by `]d`.
|
|
145
|
+
|
|
146
|
+
[09-20,1] Get a Flu Shot
|
|
147
|
+
This will be sent on September 20.
|
|
148
|
+
By the way, anything underneath a reminder tag is considered a note and will
|
|
149
|
+
be sent in the body of the email.
|
|
150
|
+
|
|
151
|
+
[dow,fri] Submit Timesheet
|
|
152
|
+
<b>Will be sent every Friday. Reminder notes support HTML.</b>
|
|
153
|
+
|
|
154
|
+
[dow,fri,2] Payday!
|
|
155
|
+
- This will send every other Friday.
|
|
156
|
+
|
|
157
|
+
[dow,thu,1]c ls > /home/tyler/directory.log
|
|
158
|
+
- Reminders ending with `]c` will be executed as commands, rather than
|
|
159
|
+
sent as emails.
|
|
160
|
+
|
|
161
|
+
[d,1] 40 Daily Pushups
|
|
162
|
+
This is sent each day.
|
|
163
|
+
|
|
164
|
+
[later] play diplomacy board game
|
|
165
|
+
This isn't sent, but it is saved for later and can be sent using
|
|
166
|
+
`remind --later`.
|
|
167
|
+
|
|
168
|
+
# Contributing
|
|
169
|
+
Contributions to RemindMail are welcome! Please feel free to fork the repository, make your changes, and submit a pull request.
|
|
170
|
+
|
|
171
|
+
# License
|
|
172
|
+
RemindMail is released under the MIT license. For more details, see the LICENSE file in the repository.
|
|
173
|
+
|
|
174
|
+
# Author Info
|
|
175
|
+
Tyler Woodfin
|
|
176
|
+
https://tyler.cloud
|
|
177
|
+
feedback-remindmail@tyler.cloud
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[metadata]
|
|
2
|
+
name = remindmail
|
|
3
|
+
version = 1!1.9.0
|
|
4
|
+
author = Tyler Woodfin
|
|
5
|
+
author_email = feedback-remindmail@tyler.cloud
|
|
6
|
+
description = Easily schedule reminders to be emailed
|
|
7
|
+
long_description = file: README.md
|
|
8
|
+
long_description_content_type = text/markdown
|
|
9
|
+
url = https://github.com/tylerjwoodfin/remindmail
|
|
10
|
+
project_urls =
|
|
11
|
+
bug tracker = https://github.com/tylerjwoodfin/remindmail/issues
|
|
12
|
+
py_modules = ["remind"]
|
|
13
|
+
classifiers =
|
|
14
|
+
programming language = : Python :: 3
|
|
15
|
+
license = : OSI Approved :: MIT License
|
|
16
|
+
operating system = : OS Independent
|
|
17
|
+
|
|
18
|
+
[options]
|
|
19
|
+
package_dir =
|
|
20
|
+
= src
|
|
21
|
+
packages = find:
|
|
22
|
+
python_requires = >=3.6
|
|
23
|
+
|
|
24
|
+
[options.packages.find]
|
|
25
|
+
where = src
|
|
26
|
+
|
|
27
|
+
[options.entry_points]
|
|
28
|
+
console_scripts =
|
|
29
|
+
remind=remind.__main__:main
|
|
30
|
+
|
|
31
|
+
[egg_info]
|
|
32
|
+
tag_build =
|
|
33
|
+
tag_date = 0
|
|
34
|
+
|
|
File without changes
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The main entrypoint
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
from . import reminder_manager
|
|
8
|
+
from . import query_manager
|
|
9
|
+
|
|
10
|
+
def handle_args(manager_r: reminder_manager.ReminderManager,
|
|
11
|
+
manager_q: query_manager.QueryManager) -> None:
|
|
12
|
+
"""
|
|
13
|
+
Parse arguments passed to RemindMail
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
parser = argparse.ArgumentParser(description="A tool to schedule and organize reminders")
|
|
17
|
+
|
|
18
|
+
# parameter arguments
|
|
19
|
+
parser.add_argument(
|
|
20
|
+
"--title",
|
|
21
|
+
help="the title of your reminder",
|
|
22
|
+
nargs="+",
|
|
23
|
+
default=None
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
parser.add_argument(
|
|
27
|
+
"--when",
|
|
28
|
+
"--d",
|
|
29
|
+
help="when the reminder should send, as natural language",
|
|
30
|
+
nargs="?",
|
|
31
|
+
const="")
|
|
32
|
+
|
|
33
|
+
parser.add_argument(
|
|
34
|
+
"--notes",
|
|
35
|
+
"--n",
|
|
36
|
+
help="notes for the body of the email",
|
|
37
|
+
nargs="?",
|
|
38
|
+
const=""
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
parser.add_argument(
|
|
42
|
+
"--later",
|
|
43
|
+
action="store_true",
|
|
44
|
+
help="show reminders scheduled for later"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
parser.add_argument(
|
|
48
|
+
"--save",
|
|
49
|
+
action="store_true",
|
|
50
|
+
help="save reminder without confirmation"
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# action arguments
|
|
54
|
+
parser.add_argument(
|
|
55
|
+
"--generate",
|
|
56
|
+
"--g",
|
|
57
|
+
action="store_true",
|
|
58
|
+
help="generate reminders.",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
"--edit",
|
|
63
|
+
action="store_true",
|
|
64
|
+
help="edit the remindmail file")
|
|
65
|
+
|
|
66
|
+
parser.add_argument(
|
|
67
|
+
"--show-tomorrow",
|
|
68
|
+
"--st",
|
|
69
|
+
action="store_true",
|
|
70
|
+
help="show a list of reminders scheduled for tomorrow",
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
parser.add_argument(
|
|
74
|
+
"--send-later",
|
|
75
|
+
"--sl",
|
|
76
|
+
action="store_true",
|
|
77
|
+
help="sends a list of reminders scheduled for `later`"
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
parser.add_argument(
|
|
81
|
+
"--show-week",
|
|
82
|
+
"--sw",
|
|
83
|
+
action="store_true",
|
|
84
|
+
help="show reminders through next 7 days",
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
try:
|
|
88
|
+
args = parser.parse_args()
|
|
89
|
+
|
|
90
|
+
if args.generate:
|
|
91
|
+
manager_r.generate()
|
|
92
|
+
elif args.later:
|
|
93
|
+
manager_r.show_later()
|
|
94
|
+
elif args.edit:
|
|
95
|
+
manager_r.edit_reminders_file()
|
|
96
|
+
elif args.show_tomorrow:
|
|
97
|
+
manager_r.show_reminders_for_days(2)
|
|
98
|
+
elif args.show_week:
|
|
99
|
+
manager_r.show_reminders_for_days()
|
|
100
|
+
elif args.send_later:
|
|
101
|
+
manager_r.send_later()
|
|
102
|
+
else:
|
|
103
|
+
# handle title
|
|
104
|
+
title = args.title
|
|
105
|
+
if isinstance(title, list):
|
|
106
|
+
title = ' '.join(title)
|
|
107
|
+
elif isinstance(title, str):
|
|
108
|
+
title = title.strip()
|
|
109
|
+
|
|
110
|
+
manager_q.wizard_manual_reminder(
|
|
111
|
+
title=title,
|
|
112
|
+
when=args.when,
|
|
113
|
+
notes=args.notes,
|
|
114
|
+
save=args.save
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
except KeyboardInterrupt as exc:
|
|
118
|
+
raise KeyboardInterrupt from exc
|
|
119
|
+
|
|
120
|
+
def main():
|
|
121
|
+
"""
|
|
122
|
+
The main function
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
manager_remind = reminder_manager.ReminderManager()
|
|
126
|
+
manager_query = query_manager.QueryManager(manager_remind)
|
|
127
|
+
|
|
128
|
+
try:
|
|
129
|
+
handle_args(manager_remind, manager_query)
|
|
130
|
+
except KeyboardInterrupt:
|
|
131
|
+
print("\n")
|
|
132
|
+
|
|
133
|
+
if __name__ == "__main__":
|
|
134
|
+
main()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Handles errors and data integrity issues
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import traceback
|
|
6
|
+
from typing import Callable
|
|
7
|
+
from functools import wraps
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
class ErrorHandler:
|
|
11
|
+
"""
|
|
12
|
+
Handles and tries to resolve errors
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def exception_handler(func: Callable) -> Callable:
|
|
17
|
+
"""
|
|
18
|
+
A decorator to handle exceptions raised by the function it wraps
|
|
19
|
+
"""
|
|
20
|
+
@wraps(func)
|
|
21
|
+
def wrapper(self, *args, **kwargs):
|
|
22
|
+
try:
|
|
23
|
+
return func(self, *args, **kwargs)
|
|
24
|
+
except FileNotFoundError as e:
|
|
25
|
+
filename = getattr(e, 'filename', 'Unknown file')
|
|
26
|
+
self.cabinet.log(f"'{filename}' was not found in {func.__name__}.", level="error")
|
|
27
|
+
|
|
28
|
+
resolved = self.help_set_path_remindmd()
|
|
29
|
+
if resolved:
|
|
30
|
+
return func(self, *args, **kwargs)
|
|
31
|
+
else:
|
|
32
|
+
sys.exit()
|
|
33
|
+
except PermissionError as e:
|
|
34
|
+
print(f"Error: Permission denied when accessing the file '{e}'.")
|
|
35
|
+
# pylint: disable=W0718
|
|
36
|
+
except Exception as e:
|
|
37
|
+
print(f"An unexpected error occurred while processing '{e}': {e}")
|
|
38
|
+
traceback.print_exc()
|
|
39
|
+
|
|
40
|
+
return wrapper
|