diff -Nru remindor-common-13.08.2/data/html/services.html remindor-common-14.01/data/html/services.html
--- remindor-common-13.08.2/data/html/services.html 2013-07-30 11:27:18.000000000 +0000
+++ remindor-common-14.01/data/html/services.html 2014-01-13 01:00:38.000000000 +0000
@@ -366,7 +366,14 @@
Windows and Andriod) that allows you to receive instant push notifications from various
apps. Remindor apps can send notifications to your Boxcar enabled devices if you set
it up your Boxcar email in preferences.
-
+
+
diff -Nru remindor-common-13.08.2/debian/changelog remindor-common-14.01/debian/changelog
--- remindor-common-13.08.2/debian/changelog 2013-10-14 01:15:53.000000000 +0000
+++ remindor-common-14.01/debian/changelog 2014-01-13 22:00:42.000000000 +0000
@@ -1,3 +1,9 @@
+remindor-common (14.01-0ubuntu1~raring) raring; urgency=low
+
+ * Added Pushbullet integration
+
+ -- Brian Douglass Mon, 06 Jan 2014 20:56:00 -0500
+
remindor-common (13.08.2-0ubuntu1~raring) raring; urgency=low
* Fixed translations causing add reminder window to not popup
diff -Nru remindor-common-13.08.2/po/remindor-common.pot remindor-common-14.01/po/remindor-common.pot
--- remindor-common-13.08.2/po/remindor-common.pot 2013-08-12 11:04:26.000000000 +0000
+++ remindor-common-14.01/po/remindor-common.pot 2014-01-13 21:59:05.000000000 +0000
@@ -8,814 +8,118 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-08-12 07:04-0400\n"
+"POT-Creation-Date: 2014-01-13 16:59-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"Language: \n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../data/ui/PreferencesDialog.ui.h:1
-#: ../data/ui/IndicatorRemindorWindow.ui.h:19
-#: ../remindor_qt/PreferencesDialog.py:216
-#: ../remindor_qt/RemindorQtWindow.py:134
-msgid "Preferences"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:2 ../remindor_qt/PreferencesDialog.py:232
-msgid "Default Label"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:3 ../remindor_qt/PreferencesDialog.py:233
-msgid "Default Time"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:4 ../remindor_qt/PreferencesDialog.py:234
-msgid "Default Date"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:5 ../remindor_qt/PreferencesDialog.py:235
-msgid "Default Command"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:6 ../remindor_qt/PreferencesDialog.py:236
-msgid "Minutes to Postpone"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:7 ../remindor_common/database.py:208
-#: ../remindor_common/datetimeutil.py:974
-#: ../remindor_common/datetimeutil.py:1053
-msgid "now"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:8 ../remindor_common/database.py:208
-#: ../remindor_common/datetimeutil.py:937
-#: ../remindor_common/datetimeutil.py:998
-msgid "today"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:9 ../remindor_qt/PreferencesDialog.py:219
-msgid "Standard Reminders"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:10 ../data/ui/ReminderDialog.ui.h:22
-#: ../remindor_qt/ReminderDialog.py:144
-#: ../remindor_qt/PreferencesDialog.py:242
-msgid "Popup"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:11
-msgid ""
-"Change Indicator\n"
-"Icon on Reminder"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:13 ../remindor_common/helpers.py:346
-#: ../remindor_qt/PreferencesDialog.py:243
-msgid "Dialog"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:14
-#: ../remindor_qt/PreferencesDialog.py:220
-msgid "Notifications"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:15
-#: ../remindor_qt/PreferencesDialog.py:252
-msgid "Default Quick Label"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:16
-#: ../remindor_qt/PreferencesDialog.py:253
-msgid "Default Quick Time"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:17
-#: ../remindor_qt/PreferencesDialog.py:258
-#: ../remindor_qt/PreferencesDialog.py:272
-msgid ""
-"Use standard reminder\n"
-"sound settings"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:19
-#: ../remindor_qt/PreferencesDialog.py:256
-#: ../remindor_qt/PreferencesDialog.py:270
-msgid "Popup Notification"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:20
-#: ../remindor_qt/PreferencesDialog.py:257
-#: ../remindor_qt/PreferencesDialog.py:271
-msgid "Dialog Notification"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:21
-#: ../remindor_qt/PreferencesDialog.py:259
-msgid "Show info on dialog"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:22
-#: ../remindor_qt/PreferencesDialog.py:255
-msgid "Use Slider"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:23
-#: ../remindor_qt/PreferencesDialog.py:254
-msgid "Default Quick Unit"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:24 ../remindor_qt/QuickDialog.py:86
-#: ../data/ui/QuickDialog.ui.h:4 ../remindor_qt/PreferencesDialog.py:262
-msgid "minute(s)"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:25 ../remindor_qt/QuickDialog.py:87
-#: ../data/ui/QuickDialog.ui.h:5 ../remindor_qt/PreferencesDialog.py:263
-msgid "hour(s)"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:26 ../data/ui/QuickDialog.ui.h:6
-msgid "day(s)"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:27
-#: ../remindor_qt/PreferencesDialog.py:222
-msgid "Quick Reminders"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:28
-#: ../remindor_qt/PreferencesDialog.py:223
-msgid "Simple Reminders"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:29
-#: ../remindor_qt/PreferencesDialog.py:246
-msgid "Default Sound File"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:30
-#: ../remindor_qt/PreferencesDialog.py:247
-msgid "Default Play Length"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:31 ../data/ui/ReminderDialog.ui.h:30
-#: ../remindor_qt/ReminderDialog.py:154
-#: ../remindor_qt/PreferencesDialog.py:248
-msgid "s (0 for end)"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:32
-#: ../remindor_qt/PreferencesDialog.py:249
-msgid "Loop Sound"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:33
-#: ../remindor_qt/PreferencesDialog.py:250
-msgid "Times to Loop"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:34 ../data/ui/ReminderDialog.ui.h:31
-#: ../remindor_qt/ReminderDialog.py:149 ../remindor_common/helpers.py:346
-#: ../remindor_qt/PreferencesDialog.py:221
-msgid "Sound"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:35
-#: ../remindor_qt/PreferencesDialog.py:274
-msgid "Today's Reminder Color"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:36
-#: ../remindor_qt/PreferencesDialog.py:275
-msgid "Future Reminder Color"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:37
-#: ../remindor_qt/PreferencesDialog.py:276
-msgid "Past Reminder Color"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:38
-#: ../remindor_qt/PreferencesDialog.py:277
-msgid ""
-"Show News\n"
-"Notifications"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:40
-msgid "Hide Indicator"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:41
-msgid "Indicator Icon"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:42
-#: ../remindor_qt/PreferencesDialog.py:282
-msgid "System Theme"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:43
-#: ../remindor_qt/PreferencesDialog.py:283
-msgid "Light Icon"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:44
-#: ../remindor_qt/PreferencesDialog.py:284
-msgid "Dark Icon"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:45
-#: ../remindor_qt/PreferencesDialog.py:285
-msgid "App Icon"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:46
-#: ../remindor_qt/PreferencesDialog.py:224
-msgid "Interface"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:47
-#: ../remindor_qt/PreferencesDialog.py:291
-msgid "Time Format"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:48
-#: ../remindor_qt/PreferencesDialog.py:292
-msgid "Date Format"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:49
-#: ../remindor_qt/PreferencesDialog.py:225
-msgid "Format"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:50
-#: ../remindor_qt/PreferencesDialog.py:294
-msgid "Boxcar Email"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:51
-#: ../remindor_qt/PreferencesDialog.py:295
-msgid "Boxcar Notification"
-msgstr ""
-
-#: ../data/ui/PreferencesDialog.ui.h:52
-#: ../remindor_qt/PreferencesDialog.py:226
-msgid "Services"
+#: ../remindor_common/helpers.py:86
+msgid "usage: %prog [option]"
msgstr ""
-#: ../data/ui/AboutDialog.ui.h:1
-msgid "Copyright (C) 2013 Brian Douglass"
+#: ../remindor_common/helpers.py:91
+msgid "Show debug messages (-vv debugs remindor_common also)"
msgstr ""
-#: ../data/ui/AboutDialog.ui.h:2 ../data/ui/IndicatorRemindorWindow.ui.h:15
-#: ../remindor_qt/RemindorQtWindow.py:146
-msgid "Website"
+#: ../remindor_common/helpers.py:92
+msgid "Show Add Reminder window and exit"
msgstr ""
-#: ../data/ui/AboutDialog.ui.h:3
-msgid ""
-"Copyright (C) 2013 Brian Douglass\n"
-"This program is free software: you can redistribute it and/or modify it\n"
-"under the terms of the GNU General Public License version 3, as published\n"
-"by the Free Software Foundation.\n"
-"\n"
-"This program is distributed in the hope that it will be useful, but\n"
-"WITHOUT ANY WARRANTY; without even the implied warranties of\n"
-"MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR\n"
-"PURPOSE. See the GNU General Public License for more details.\n"
-"\n"
-"You should have received a copy of the GNU General Public License along\n"
-"with this program. If not, see ."
+#: ../remindor_common/helpers.py:93
+msgid "Show Quick Reminder window and exit"
msgstr ""
-#: ../data/ui/AboutDialog.ui.h:15
+#: ../remindor_common/helpers.py:94
msgid ""
-"Sid Roberts (UK English)\n"
-"jc1 (French)\n"
-"ConnyLo (German)\n"
-"Jan Schürmann (German)\n"
-"Tomas Lycken (Gernam)\n"
-"A.J. Baudrez (Dutch)\n"
-"Pastor (Polish)\n"
-"asensio (Portuguese)\n"
-"Laurențiu Lozan (Romanian)"
-msgstr ""
-
-#: ../remindor_qt/QuickDialog.py:80 ../data/ui/QuickDialog.ui.h:1
-msgid "Add Quick Reminder"
-msgstr ""
-
-#: ../remindor_qt/QuickDialog.py:81 ../data/ui/ReminderDialog.ui.h:2
-#: ../indicator_remindor/IndicatorRemindorWindow.py:112
-#: ../data/ui/QuickDialog.ui.h:3 ../remindor_qt/ReminderDialog.py:132
-msgid "Label"
-msgstr ""
-
-#: ../remindor_qt/QuickDialog.py:82 ../remindor_qt/QuickDialog.py:83
-#: ../data/ui/QuickDialog.ui.h:2
-msgid "In"
-msgstr ""
-
-#: ../remindor_qt/QuickDialog.py:88 ../remindor_qt/PreferencesDialog.py:264
-msgid "days(s)"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:1 ../remindor_qt/DateDialog.py:80
-msgid "Edit Date"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:2 ../data/ui/ReminderDialog.ui.h:5
-#: ../indicator_remindor/IndicatorRemindorWindow.py:128
-#: ../data/ui/CommandDialog.ui.h:5 ../remindor_qt/ReminderDialog.py:110
-#: ../remindor_qt/ReminderDialog.py:134 ../remindor_qt/CommandDialog.py:55
-#: ../remindor_qt/DateDialog.py:81
-msgid "Date"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:3 ../data/ui/TimeDialog.ui.h:6
-#: ../remindor_qt/TimeDialog.py:82 ../remindor_qt/DateDialog.py:90
-msgid "Once"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:4 ../remindor_qt/DateDialog.py:91
-msgid "Every Day"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:5 ../remindor_qt/DateDialog.py:92
-msgid "Every X Days"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:6 ../remindor_qt/DateDialog.py:93
-msgid "Every Xth of the Month"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:7 ../remindor_qt/DateDialog.py:94
-msgid "Every "
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:8 ../remindor_qt/DateDialog.py:95
-msgid "Every Other Day"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:9 ../remindor_qt/DateDialog.py:96
-msgid "Next X Days"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:10 ../remindor_qt/DateDialog.py:82
-msgid "On"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:11 ../data/ui/TimeDialog.ui.h:4
-#: ../remindor_qt/TimeDialog.py:91 ../remindor_qt/DateDialog.py:83
-#: ../remindor_qt/DateDialog.py:84 ../remindor_qt/DateDialog.py:201
-#: ../remindor_qt/DateDialog.py:208 ../indicator_remindor/helperdialogs.py:190
-#: ../indicator_remindor/helperdialogs.py:201
-msgid "Every"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:12 ../remindor_qt/DateDialog.py:205
-#: ../indicator_remindor/helperdialogs.py:194
-#: ../indicator_remindor/helperdialogs.py:229
-msgid "Day(s)"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:13 ../remindor_qt/DateDialog.py:106
-#: ../remindor_qt/DateDialog.py:120
-msgid "Monday"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:14 ../remindor_qt/DateDialog.py:107
-#: ../remindor_qt/DateDialog.py:121
-msgid "Tuesday"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:15 ../remindor_qt/DateDialog.py:108
-#: ../remindor_qt/DateDialog.py:122
-msgid "Wednesday"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:16 ../remindor_qt/DateDialog.py:109
-#: ../remindor_qt/DateDialog.py:123
-msgid "Thursday"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:17 ../remindor_qt/DateDialog.py:110
-#: ../remindor_qt/DateDialog.py:124
-msgid "Friday"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:18 ../remindor_qt/DateDialog.py:111
-#: ../remindor_qt/DateDialog.py:125
-msgid "Saturday"
-msgstr ""
-
-#: ../data/ui/DateDialog.ui.h:19 ../remindor_qt/DateDialog.py:112
-#: ../remindor_qt/DateDialog.py:126
-msgid "Sunday"
+"Show Manage window and exit (only works if another instance is already "
+"running)"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:20 ../remindor_qt/DateDialog.py:127
-msgid "Weekday"
+#: ../remindor_common/helpers.py:95
+msgid "Show Preferences window and exit"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:21 ../remindor_qt/DateDialog.py:128
-msgid "Weekend"
+#: ../remindor_common/helpers.py:96
+msgid "Stops sound and exits"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:22 ../data/ui/TimeDialog.ui.h:5
-#: ../remindor_qt/TimeDialog.py:92 ../remindor_qt/DateDialog.py:85
-msgid "From"
+#: ../remindor_common/helpers.py:97
+msgid "Forces an update of the reminder list"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:23 ../data/ui/TimeDialog.ui.h:9
-#: ../remindor_qt/TimeDialog.py:93 ../remindor_qt/DateDialog.py:86
-msgid "To"
+#: ../remindor_common/helpers.py:98
+msgid "Requests that other instances exit."
msgstr ""
-#: ../data/ui/DateDialog.ui.h:24 ../remindor_qt/DateDialog.py:103
-msgid "Other"
+#: ../remindor_common/helpers.py:99
+msgid "Show Simple Reminder window and exit"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:25 ../remindor_qt/DateDialog.py:104
-msgid "Today"
+#: ../remindor_common/helpers.py:229 ../remindor_common/helpers.py:233
+#: ../remindor_common/helpers.py:405 ../remindor_common/helpers.py:409
+#: ../remindor_common/helpers.py:413
+msgid "No"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:26 ../remindor_qt/DateDialog.py:105
-msgid "Tomorrow"
+#: ../remindor_common/helpers.py:231 ../remindor_common/helpers.py:235
+#: ../remindor_common/helpers.py:403 ../remindor_common/helpers.py:407
+#: ../remindor_common/helpers.py:411
+msgid "Yes"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:27 ../remindor_qt/DateDialog.py:113
-msgid "Christmas"
+#: ../remindor_common/helpers.py:237 ../remindor_common/helpers.py:242
+#: ../remindor_common/helpers.py:425 ../remindor_common/helpers.py:431
+msgid "None"
msgstr ""
-#: ../data/ui/DateDialog.ui.h:28 ../data/ui/TimeDialog.ui.h:10
-#: ../remindor_qt/TimeDialog.py:94 ../remindor_qt/DateDialog.py:87
-msgid "From must be before To"
+#: ../remindor_common/helpers.py:245
+msgid "(Using standard reminder sound settings)"
msgstr ""
-#: ../indicator_remindor/PreferencesDialog.py:196
-#: ../remindor_qt/PreferencesDialog.py:472
+#: ../remindor_common/helpers.py:247
#, python-format
msgid ""
-"You have chosen to hide the indicator.\n"
-"Only use this option if you know what you are doing!\n"
-"\n"
-"You can run the command \"%s -p\"\n"
-"from the command line to open the preferences dialog\n"
-"to change this option.\n"
-"\n"
-"Would you like to continue?"
-msgstr ""
-
-#: ../indicator_remindor/PreferencesDialog.py:271
-#: ../remindor_qt/PreferencesDialog.py:463
-msgid ""
-"It seems that you are not yet signed up for Boxcar.\n"
-"Please visit boxcar.io to signup."
-msgstr ""
-
-#: ../indicator_remindor/PreferencesDialog.py:279
-#: ../remindor_qt/PreferencesDialog.py:467
-msgid ""
-"There has been a error connecting with Boxcar,\n"
-"please check your email address or network connection."
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:1 ../remindor_qt/ReminderDialog.py:102
-msgid "Add Reminder"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:3 ../data/ui/CommandDialog.ui.h:20
-#: ../remindor_qt/ReminderDialog.py:125 ../remindor_qt/ReminderDialog.py:135
-#: ../remindor_common/helpers.py:346 ../remindor_qt/CommandDialog.py:75
-msgid "Command"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:4 ../data/ui/TimeDialog.ui.h:2
-#: ../indicator_remindor/IndicatorRemindorWindow.py:120
-#: ../data/ui/CommandDialog.ui.h:12 ../remindor_qt/ReminderDialog.py:117
-#: ../remindor_qt/ReminderDialog.py:133 ../remindor_qt/CommandDialog.py:62
-#: ../remindor_qt/TimeDialog.py:79
-msgid "Time"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:6 ../remindor_qt/ReminderDialog.py:136
-msgid "Notes:"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:7 ../data/ui/CommandDialog.ui.h:4
-msgid "Insert:"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:8 ../data/ui/CommandDialog.ui.h:6
-#: ../remindor_qt/ReminderDialog.py:111 ../remindor_qt/CommandDialog.py:56
-msgid "Month"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:9 ../data/ui/CommandDialog.ui.h:7
-#: ../remindor_qt/ReminderDialog.py:112 ../remindor_qt/CommandDialog.py:57
-msgid "Month Name"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:10 ../data/ui/CommandDialog.ui.h:8
-#: ../remindor_qt/ReminderDialog.py:113 ../remindor_qt/CommandDialog.py:58
-msgid "Day"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:11 ../data/ui/CommandDialog.ui.h:9
-#: ../remindor_qt/ReminderDialog.py:114 ../remindor_qt/CommandDialog.py:59
-msgid "Day Name"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:12 ../data/ui/CommandDialog.ui.h:10
-#: ../remindor_qt/ReminderDialog.py:115 ../remindor_qt/CommandDialog.py:60
-msgid "Day of Year"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:13 ../data/ui/CommandDialog.ui.h:11
-#: ../remindor_qt/ReminderDialog.py:116 ../remindor_qt/CommandDialog.py:61
-msgid "Year"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:14 ../data/ui/CommandDialog.ui.h:13
-#: ../remindor_qt/ReminderDialog.py:118 ../remindor_qt/CommandDialog.py:63
-msgid "Hour (24)"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:15 ../data/ui/CommandDialog.ui.h:14
-#: ../remindor_qt/ReminderDialog.py:119 ../remindor_qt/CommandDialog.py:64
-msgid "Hour (12)"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:16 ../data/ui/CommandDialog.ui.h:15
-#: ../remindor_qt/ReminderDialog.py:120 ../remindor_qt/CommandDialog.py:65
-msgid "Minutes"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:17 ../data/ui/CommandDialog.ui.h:16
-#: ../remindor_qt/ReminderDialog.py:121 ../remindor_qt/CommandDialog.py:66
-msgid "Seconds"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:18 ../data/ui/CommandDialog.ui.h:17
-#: ../remindor_qt/ReminderDialog.py:122 ../remindor_qt/CommandDialog.py:67
-msgid "Microseconds"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:19 ../data/ui/CommandDialog.ui.h:18
-#: ../remindor_qt/ReminderDialog.py:123 ../remindor_qt/CommandDialog.py:68
-msgid "Sound File/Path"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:20 ../data/ui/CommandDialog.ui.h:19
-#: ../remindor_qt/ReminderDialog.py:124 ../remindor_qt/ReminderDialog.py:151
-#: ../remindor_qt/CommandDialog.py:69
-msgid "Sound File"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:21 ../remindor_common/scheduler.py:136
-#: ../remindor_qt/ReminderDialog.py:131
-msgid "Reminder"
-msgstr ""
-
-#. self.boxcar_check #doesn't need translated
-#: ../data/ui/ReminderDialog.ui.h:23 ../remindor_qt/ReminderDialog.py:147
-msgid ""
-"Boxcar has not been\n"
-"setup in Preferences"
+"Popup: %s\n"
+"Dialog: %s\n"
+"Sound File: %s"
msgstr ""
-#: ../data/ui/ReminderDialog.ui.h:25 ../remindor_qt/ReminderDialog.py:145
-msgid "Dialog Box"
+#: ../remindor_common/helpers.py:433
+msgid "Sound"
msgstr ""
-#: ../data/ui/ReminderDialog.ui.h:26 ../remindor_qt/ReminderDialog.py:143
-#: ../remindor_common/helpers.py:346
+#: ../remindor_common/helpers.py:433
msgid "Notification"
msgstr ""
-#: ../data/ui/ReminderDialog.ui.h:27 ../remindor_qt/ReminderDialog.py:150
-msgid "Play Sound"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:28 ../remindor_qt/ReminderDialog.py:152
-msgid "Play Length"
-msgstr ""
-
-#: ../data/ui/ReminderDialog.ui.h:29 ../remindor_qt/ReminderDialog.py:153
-msgid "Loop"
-msgstr ""
-
-#: ../data/ui/TimeDialog.ui.h:1 ../remindor_qt/TimeDialog.py:78
-msgid "Edit Time"
-msgstr ""
-
-#: ../data/ui/TimeDialog.ui.h:3 ../remindor_qt/TimeDialog.py:90
-msgid "At"
-msgstr ""
-
-#: ../data/ui/TimeDialog.ui.h:7 ../remindor_qt/TimeDialog.py:83
-msgid "Every X Minutes"
-msgstr ""
-
-#: ../data/ui/TimeDialog.ui.h:8 ../remindor_qt/TimeDialog.py:84
-msgid "Every X Hours"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:79
-#: ../data/ui/IndicatorRemindorWindow.ui.h:4
-#: ../remindor_qt/ReminderDialog.py:138 ../remindor_qt/ReminderDialog.py:139
-#: ../remindor_qt/ReminderDialog.py:140
-#: ../remindor_qt/PreferencesDialog.py:238
-#: ../remindor_qt/PreferencesDialog.py:239
-#: ../remindor_qt/PreferencesDialog.py:240
-#: ../remindor_qt/RemindorQtWindow.py:88
-#: ../remindor_qt/RemindorQtWindow.py:131
-msgid "Edit"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:92
-#: ../data/ui/IndicatorRemindorWindow.ui.h:5
-#: ../remindor_qt/RemindorQtWindow.py:91
-#: ../remindor_qt/RemindorQtWindow.py:132
-#: ../remindor_qt/RemindorQtWindow.py:202
-msgid "Postpone"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:99
-#: ../data/ui/IndicatorRemindorWindow.ui.h:18
-#: ../remindor_qt/RemindorQtWindow.py:94
-#: ../remindor_qt/RemindorQtWindow.py:133
-msgid "Delete"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:136
-msgid "Notes"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:210
-#: ../indicator_remindor/IndicatorRemindorWindow.py:422
-#: ../data/ui/IndicatorRemindorWindow.ui.h:20
-#: ../remindor_qt/RemindorQtWindow.py:135
-#: ../remindor_qt/RemindorQtWindow.py:222
-#: ../remindor_qt/RemindorQtWindow.py:304
-msgid "News"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:332
-#: ../remindor_qt/RemindorQtWindow.py:201
-msgid "Sorry, you cannot postpone a repeating time."
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:420
-#: ../remindor_qt/RemindorQtWindow.py:302
-msgid "New News"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:438
-#: ../remindor_qt/RemindorQtWindow.py:319
-msgid "Today's Reminders"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:439
-#: ../remindor_qt/RemindorQtWindow.py:326
-msgid "Future Reminders"
-msgstr ""
-
-#: ../indicator_remindor/IndicatorRemindorWindow.py:440
-#: ../remindor_qt/RemindorQtWindow.py:333
-msgid "Past Reminders"
-msgstr ""
-
-#: ../remindor_qt/AboutDialog.py:42
-msgid "About Remindor-Qt"
-msgstr ""
-
-#: ../remindor_qt/AboutDialog.py:43
-msgid "License: GPL-3"
-msgstr ""
-
-#: ../remindor_qt/AboutDialog.py:44 ../remindor_qt/AboutDialog.py:54
-msgid "Credits"
-msgstr ""
-
-#: ../remindor_qt/AboutDialog.py:45 ../remindor_qt/RemindorQtWindow.py:137
-msgid "Close"
-msgstr ""
-
-#: ../remindor_qt/AboutDialog.py:53
-msgid ""
-"Author: Brian Douglass\n"
-"\n"
-"Translators:\n"
-"Sid Roberts (UK English)\n"
-"jc1 (French)\n"
-"ConnyLo (German)\n"
-"Jan Schürmann (German)\n"
-"Tomas Lycken (Gernam)\n"
-"A.J. Baudrez (Dutch)\n"
-"Pastor (Polish)\n"
-"asensio (Portuguese)\n"
-"Laurențiu Lozan (Romanian)"
-msgstr ""
-
-#: ../indicator_remindor/indicator.py:42
-#: ../data/ui/IndicatorRemindorWindow.ui.h:16
-#: ../remindor_qt/SimpleDialog.py:60 ../remindor_qt/ReminderDialog.py:106
-#: ../remindor_qt/RemindorQtWindow.py:101
-#: ../remindor_qt/RemindorQtWindow.py:129
-msgid "Add"
-msgstr ""
-
-#: ../indicator_remindor/indicator.py:53
-#: ../data/ui/IndicatorRemindorWindow.ui.h:17
-#: ../remindor_qt/RemindorQtWindow.py:102
-msgid "Simple Add"
-msgstr ""
-
-#: ../indicator_remindor/indicator.py:64
-#: ../data/ui/IndicatorRemindorWindow.ui.h:3
-#: ../remindor_qt/RemindorQtWindow.py:103
-#: ../remindor_qt/RemindorQtWindow.py:130
-msgid "Quick Add"
-msgstr ""
-
-#: ../indicator_remindor/indicator.py:75
-#: ../remindor_qt/RemindorQtWindow.py:104
-#: ../remindor_qt/RemindorQtWindow.py:148
-msgid "Stop Sound"
-msgstr ""
-
-#: ../indicator_remindor/indicator.py:86
-#: ../remindor_qt/RemindorQtWindow.py:105
-msgid "Manage"
+#: ../remindor_common/helpers.py:433
+msgid "Dialog"
msgstr ""
-#: ../indicator_remindor/indicator.py:93
-#: ../remindor_qt/RemindorQtWindow.py:106
-#: ../remindor_qt/RemindorQtWindow.py:138
-msgid "Quit"
+#: ../remindor_common/helpers.py:433
+msgid "Command"
msgstr ""
-#: ../remindor_common/database.py:208
+#: ../remindor_common/database.py:214
msgid "Quick Reminder"
msgstr ""
-#: ../data/ui/IndicatorRemindorWindow.ui.h:1
-msgid "Manage Reminders"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:2
-msgid "File"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:6
-msgid "View"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:7
-#: ../remindor_qt/RemindorQtWindow.py:140
-msgid "Clear Icon"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:8
-msgid "Contribute"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:9
-#: ../remindor_qt/RemindorQtWindow.py:141
-msgid "Submit Bugs"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:10
-msgid "Request a Feature"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:11
-#: ../remindor_qt/RemindorQtWindow.py:143
-msgid "Help Translate"
-msgstr ""
-
-#: ../data/ui/IndicatorRemindorWindow.ui.h:12
-#: ../remindor_qt/RemindorQtWindow.py:144
-msgid "Donate"
+#: ../remindor_common/database.py:214 ../remindor_common/datetimeutil.py:974
+#: ../remindor_common/datetimeutil.py:1053
+msgid "now"
msgstr ""
-#: ../data/ui/IndicatorRemindorWindow.ui.h:13
-#: ../remindor_qt/SimpleDialog.py:58 ../remindor_qt/ReminderDialog.py:104
-#: ../remindor_qt/PreferencesDialog.py:297
-#: ../remindor_qt/RemindorQtWindow.py:136
-msgid "Help"
+#: ../remindor_common/database.py:214 ../remindor_common/datetimeutil.py:937
+#: ../remindor_common/datetimeutil.py:998
+msgid "today"
msgstr ""
-#: ../data/ui/IndicatorRemindorWindow.ui.h:14
-#: ../remindor_qt/RemindorQtWindow.py:145
-msgid "Ask a Question"
+#: ../remindor_common/scheduler.py:142
+msgid "Reminder"
msgstr ""
#: ../remindor_common/datetimeutil.py:936
@@ -1041,220 +345,3 @@
#: ../remindor_common/datetimeutil.py:1094
msgid "on"
msgstr ""
-
-#: ../data/ui/CommandDialog.ui.h:1 ../remindor_qt/CommandDialog.py:51
-msgid "Edit Command"
-msgstr ""
-
-#: ../data/ui/CommandDialog.ui.h:2
-msgid "Command Help"
-msgstr ""
-
-#: ../data/ui/CommandDialog.ui.h:3
-msgid "Select an Application"
-msgstr ""
-
-#: ../remindor_qt/SimpleDialog.py:55 ../data/ui/SimpleDialog.ui.h:1
-msgid "Add Simple Reminder"
-msgstr ""
-
-#: ../remindor_qt/SimpleDialog.py:56 ../data/ui/SimpleDialog.ui.h:2
-msgid "Remind me to..."
-msgstr ""
-
-#: ../remindor_qt/SimpleDialog.py:59 ../remindor_qt/ReminderDialog.py:105
-#: ../remindor_qt/CommandDialog.py:76 ../remindor_qt/TimeDialog.py:96
-#: ../remindor_qt/DateDialog.py:134 ../remindor_qt/PreferencesDialog.py:298
-msgid "Cancel"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:107
-#: ../remindor_qt/PreferencesDialog.py:299
-#: ../indicator_remindor/ReminderDialog.py:109
-msgid "Save"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:141 ../remindor_qt/CommandDialog.py:52
-msgid "Insert"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:180
-#: ../indicator_remindor/ReminderDialog.py:242
-msgid "File does not exist"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:183
-#: ../indicator_remindor/ReminderDialog.py:245
-msgid ""
-"The following file does not exist.\n"
-"Please choose another sound file."
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:185
-#: ../indicator_remindor/ReminderDialog.py:247
-msgid "Please choose a sound file."
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:194
-msgid "Empty Notifications"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:195
-#: ../indicator_remindor/ReminderDialog.py:259
-msgid ""
-"The label and notes for this reminder are empty,\n"
-"would you still like to use a notification?"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:271
-#: ../remindor_qt/PreferencesDialog.py:357
-msgid "Choose Sound"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:273
-#: ../remindor_qt/PreferencesDialog.py:359
-msgid "Sounds (*.mp3 *.ogg *.wav);;MP3 (*.mp3);;Ogg (*.ogg);;WAVE (*.wav)"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:291
-#: ../indicator_remindor/ReminderDialog.py:115
-msgid "Edit Reminder"
-msgstr ""
-
-#: ../remindor_qt/ReminderDialog.py:329
-#: ../indicator_remindor/ReminderDialog.py:106
-#, python-format
-msgid "(will loop %s times)"
-msgstr ""
-
-#: ../remindor_common/helpers.py:74
-msgid "usage: %prog [option]"
-msgstr ""
-
-#: ../remindor_common/helpers.py:77
-msgid "Show debug messages (-vv debugs remindor_common also)"
-msgstr ""
-
-#: ../remindor_common/helpers.py:78
-msgid "Show Add Reminder window and exit"
-msgstr ""
-
-#: ../remindor_common/helpers.py:79
-msgid "Show Quick Reminder window and exit"
-msgstr ""
-
-#: ../remindor_common/helpers.py:80
-msgid ""
-"Show Manage window and exit (only works if another instance is already "
-"running)"
-msgstr ""
-
-#: ../remindor_common/helpers.py:81
-msgid "Show Preferences window and exit"
-msgstr ""
-
-#: ../remindor_common/helpers.py:82
-msgid "Stops sound and exits"
-msgstr ""
-
-#: ../remindor_common/helpers.py:83
-msgid "Forces an update of the reminder list"
-msgstr ""
-
-#: ../remindor_common/helpers.py:84
-msgid "Requests that other instances exit."
-msgstr ""
-
-#: ../remindor_common/helpers.py:85
-msgid "Show Simple Reminder window and exit"
-msgstr ""
-
-#: ../remindor_common/helpers.py:148 ../remindor_common/helpers.py:152
-#: ../remindor_common/helpers.py:324 ../remindor_common/helpers.py:328
-#: ../remindor_common/helpers.py:332
-msgid "No"
-msgstr ""
-
-#: ../remindor_common/helpers.py:150 ../remindor_common/helpers.py:154
-#: ../remindor_common/helpers.py:322 ../remindor_common/helpers.py:326
-#: ../remindor_common/helpers.py:330
-msgid "Yes"
-msgstr ""
-
-#: ../remindor_common/helpers.py:156 ../remindor_common/helpers.py:161
-#: ../remindor_common/helpers.py:338 ../remindor_common/helpers.py:344
-msgid "None"
-msgstr ""
-
-#: ../remindor_common/helpers.py:164
-msgid "(Using standard reminder sound settings)"
-msgstr ""
-
-#: ../remindor_common/helpers.py:166
-#, python-format
-msgid ""
-"Popup: %s\n"
-"Dialog: %s\n"
-"Sound File: %s"
-msgstr ""
-
-#: ../remindor_qt/CommandDialog.py:77 ../remindor_qt/TimeDialog.py:97
-#: ../remindor_qt/DateDialog.py:135
-msgid "Ok"
-msgstr ""
-
-#: ../remindor_qt/CommandDialog.py:95
-msgid "Choose Command"
-msgstr ""
-
-#: ../remindor_qt/CommandDialog.py:97
-msgid "All Files (*)"
-msgstr ""
-
-#. minutes
-#: ../remindor_qt/TimeDialog.py:173 ../indicator_remindor/helperdialogs.py:401
-msgid "Minute(s)"
-msgstr ""
-
-#. hours
-#: ../remindor_qt/TimeDialog.py:175 ../indicator_remindor/helperdialogs.py:403
-msgid "Hour(s)"
-msgstr ""
-
-#: ../remindor_qt/DateDialog.py:212 ../indicator_remindor/helperdialogs.py:206
-msgid "of the month"
-msgstr ""
-
-#: ../remindor_qt/DateDialog.py:218 ../indicator_remindor/helperdialogs.py:225
-msgid "Next"
-msgstr ""
-
-#: ../remindor_qt/PreferencesDialog.py:244
-msgid ""
-"Change Tray\n"
-"Icon on Reminder"
-msgstr ""
-
-#: ../remindor_qt/PreferencesDialog.py:278
-msgid "Tray Icon"
-msgstr ""
-
-#: ../remindor_qt/PreferencesDialog.py:279
-msgid "Hide Tray Icon"
-msgstr ""
-
-#: ../remindor_qt/PreferencesDialog.py:473
-msgid "Important!"
-msgstr ""
-
-#: ../remindor_qt/RemindorQtWindow.py:139
-msgid "Refresh"
-msgstr ""
-
-#: ../remindor_qt/RemindorQtWindow.py:142
-msgid "Request Feature"
-msgstr ""
-
-#: ../remindor_qt/RemindorQtWindow.py:147
-msgid "About"
-msgstr ""
diff -Nru remindor-common-13.08.2/remindor_common/__init__.py remindor-common-14.01/remindor_common/__init__.py
--- remindor-common-13.08.2/remindor_common/__init__.py 2013-10-14 01:01:28.000000000 +0000
+++ remindor-common-14.01/remindor_common/__init__.py 2014-01-07 01:53:50.000000000 +0000
@@ -15,4 +15,4 @@
### END LICENSE
def version():
- return '13.08.2'
+ return '14.01'
diff -Nru remindor-common-13.08.2/remindor_common/config.py remindor-common-14.01/remindor_common/config.py
--- remindor-common-13.08.2/remindor_common/config.py 2013-07-23 10:35:17.000000000 +0000
+++ remindor-common-14.01/remindor_common/config.py 2014-01-03 12:14:47.000000000 +0000
@@ -20,167 +20,174 @@
from remindor_common.database import Database
class Config():
- def __init__(self, program = None, program_version = None):
- self.filename = constants.config_file
- self.database_filename = constants.database_file
- self.exists = self.load()
-
- if program is not None:
- self.set('program', program)
- if program_version is not None:
- self.set('version', program_version)
- self.set('remindor_common_version', version())
-
- if not self.exists and program is not None:
- self.import_database()
-
- def load(self):
- exists = True
- if os.path.exists(self.filename):
- self.dictionary = json.load(open(self.filename))
- else:
- self.dictionary = {}
- exists = False
-
- self.label = self.get('label', '')
- self.time = self.get('time', 'now')
- self.date = self.get('date', 'today')
- self.command = self.get('command', '')
- self.sound_file = self.get('sound_file', '')
- self.sound_play_length = self.get('sound_play_length', 10)
- self.sound_loop = self.get('sound_loop', False)
- self.sound_loop_times = self.get('sound_loop_times', 5)
- self.popup = self.get('popup', True)
- self.dialog = self.get('dialog', False)
- self.change_indicator = self.get('change_indicator', True)
- self.hide_indicator = self.get('hide_indicator', False)
- self.indicator_icon = self.get('indicator_icon', 0)
- self.postpone = self.get('postpone', 30)
-
- self.time_format = self.get('time_format', 0)
- self.date_format = self.get('date_format', 0)
- self.today_color = self.get('today_color', '#00007878ffff')
- self.future_color = self.get('future_color', '#04039e9e0000')
- self.past_color = self.get('past_color', '#ffffecec1f1f')
- self.show_news = self.get('show_news', True)
-
- self.quick_label = self.get('quick_label', '')
- self.quick_minutes = self.get('quick_minutes', 30)
- self.quick_popup = self.get('quick_popup', True)
- self.quick_dialog = self.get('quick_dialog', False)
- self.quick_sound = self.get('quick_sound', False)
- self.quick_info = self.get('quick_info', True)
- self.quick_slider = self.get('quick_slider', True)
- self.quick_unit = self.get('quick_unit', 0)
-
- self.simple_popup = self.get('simple_popup', True)
- self.simple_dialog = self.get('simple_dialog', False)
- self.simple_sound = self.get('simple_sound', False)
-
- self.boxcar_email = self.get('boxcar_email', '')
- self.boxcar_notify = self.get('boxcar_notify', 0)
-
- self.last_news = self.get('last_news', '')
- self.new_news = self.get('new_news', False)
-
- if not exists:
- self.dump()
-
- return exists
-
- def dump(self):
- self.set('label', self.label)
- self.set('time', self.time)
- self.set('date', self.date)
- self.set('command', self.command)
- self.set('sound_file', self.sound_file)
- self.set('sound_play_length', self.sound_play_length)
- self.set('sound_loop', self.sound_loop)
- self.set('sound_loop_times', self.sound_loop_times)
- self.set('popup', self.popup)
- self.set('dialog', self.dialog)
- self.set('change_indicator', self.change_indicator)
- self.set('hide_indicator', self.hide_indicator)
- self.set('indicator_icon', self.indicator_icon)
- self.set('postpone', self.postpone)
- self.set('time_format', self.time_format)
- self.set('date_format', self.date_format)
- self.set('today_color', self.today_color)
- self.set('future_color', self.future_color)
- self.set('past_color', self.past_color)
- self.set('show_news', self.show_news)
- self.set('quick_label', self.quick_label)
- self.set('quick_minutes', self.quick_minutes)
- self.set('quick_popup', self.quick_popup)
- self.set('quick_dialog', self.quick_dialog)
- self.set('quick_sound', self.quick_sound)
- self.set('quick_info', self.quick_info)
- self.set('quick_slider', self.quick_slider)
- self.set('quick_unit', self.quick_unit)
- self.set('simple_popup', self.simple_popup)
- self.set('simple_dialog', self.simple_dialog)
- self.set('simple_sound', self.simple_sound)
- self.set('boxcar_email', self.boxcar_email)
- self.set('boxcar_notify', self.boxcar_notify)
- self.set('last_news', self.last_news)
- self.set('new_news', self.new_news)
-
- json.dump(self.dictionary, open(self.filename, 'w'))
-
- def get(self, attr, default = None):
- if attr not in self.dictionary:
- self.set(attr, default)
-
- return self.dictionary[attr]
-
- def set(self, attr, value):
- self.dictionary[attr] = value
- setattr(self, attr, value)
-
- def import_database(self):
- if os.path.exists(self.database_filename):
- db = Database(self.database_filename)
- if (db.has_settings):
- settings = db.settings()
- boxcar_service = db.service('boxcar')
-
- self.set('label', settings.label)
- self.set('time', settings.time)
- self.set('date', settings.date)
- self.set('command', settings.command)
- self.set('sound_file', settings.sound_file)
- self.set('sound_play_length', settings.sound_length)
- self.set('sound_loop', settings.sound_loop)
- self.set('sound_loop_times', settings.sound_loop_times)
- self.set('popup', settings.notification)
- self.set('dialog', settings.dialog)
- self.set('change_indicator', settings.change_icon)
- self.set('hide_indicator', settings.hide_indicator)
- self.set('indicator_icon', settings.indicator_icon)
- self.set('postpone', settings.postpone)
-
- self.set('time_format', settings.time_format)
- self.set('date_format', settings.date_format)
- self.set('today_color', settings.today_color)
- self.set('future_color', settings.future_color)
- self.set('past_color', settings.past_color)
- self.set('show_news', settings.show_news)
-
- self.set('quick_label', settings.quick_label)
- self.set('quick_minutes', settings.quick_minutes)
- self.set('quick_popup', settings.quick_popup)
- self.set('quick_dialog', settings.quick_dialog)
- self.set('quick_sound', settings.quick_sound)
- self.set('quick_info', settings.quick_info)
- self.set('quick_slider', settings.quick_slider)
- self.set('quick_unit', settings.quick_unit)
-
- self.set('boxcar_email', boxcar_service.email)
- self.set('boxcar_notify', boxcar_service.default_notify)
+ def __init__(self, program = None, program_version = None):
+ self.filename = constants.config_file
+ self.database_filename = constants.database_file
+ self.exists = self.load()
+
+ if program is not None:
+ self.set('program', program)
+ if program_version is not None:
+ self.set('version', program_version)
+ self.set('remindor_common_version', version())
+
+ if not self.exists and program is not None:
+ self.import_database()
+
+ def load(self):
+ exists = True
+ if os.path.exists(self.filename):
+ self.dictionary = json.load(open(self.filename))
+ else:
+ self.dictionary = {}
+ exists = False
+
+ self.label = self.get('label', '')
+ self.time = self.get('time', 'now')
+ self.date = self.get('date', 'today')
+ self.command = self.get('command', '')
+ self.sound_file = self.get('sound_file', '')
+ self.sound_play_length = self.get('sound_play_length', 10)
+ self.sound_loop = self.get('sound_loop', False)
+ self.sound_loop_times = self.get('sound_loop_times', 5)
+ self.popup = self.get('popup', True)
+ self.dialog = self.get('dialog', False)
+ self.change_indicator = self.get('change_indicator', True)
+ self.hide_indicator = self.get('hide_indicator', False)
+ self.indicator_icon = self.get('indicator_icon', 0)
+ self.postpone = self.get('postpone', 30)
+
+ self.time_format = self.get('time_format', 0)
+ self.date_format = self.get('date_format', 0)
+ self.today_color = self.get('today_color', '#00007878ffff')
+ self.future_color = self.get('future_color', '#04039e9e0000')
+ self.past_color = self.get('past_color', '#ffffecec1f1f')
+ self.show_news = self.get('show_news', True)
+
+ self.quick_label = self.get('quick_label', '')
+ self.quick_minutes = self.get('quick_minutes', 30)
+ self.quick_popup = self.get('quick_popup', True)
+ self.quick_dialog = self.get('quick_dialog', False)
+ self.quick_sound = self.get('quick_sound', False)
+ self.quick_info = self.get('quick_info', True)
+ self.quick_slider = self.get('quick_slider', True)
+ self.quick_unit = self.get('quick_unit', 0)
+
+ self.simple_popup = self.get('simple_popup', True)
+ self.simple_dialog = self.get('simple_dialog', False)
+ self.simple_sound = self.get('simple_sound', False)
+
+ self.boxcar_email = self.get('boxcar_email', '')
+ self.boxcar_notify = self.get('boxcar_notify', 0)
+
+ self.pushbullet_api_key = self.get('pushbullet_api_key', '')
+ self.pushbullet_device = self.get('pushbullet_device', '')
+ self.pushbullet_devices = self.get('pushbullet_devices', [])
+
+ self.last_news = self.get('last_news', '')
+ self.new_news = self.get('new_news', False)
+
+ if not exists:
+ self.dump()
+
+ return exists
+
+ def dump(self):
+ self.set('label', self.label)
+ self.set('time', self.time)
+ self.set('date', self.date)
+ self.set('command', self.command)
+ self.set('sound_file', self.sound_file)
+ self.set('sound_play_length', self.sound_play_length)
+ self.set('sound_loop', self.sound_loop)
+ self.set('sound_loop_times', self.sound_loop_times)
+ self.set('popup', self.popup)
+ self.set('dialog', self.dialog)
+ self.set('change_indicator', self.change_indicator)
+ self.set('hide_indicator', self.hide_indicator)
+ self.set('indicator_icon', self.indicator_icon)
+ self.set('postpone', self.postpone)
+ self.set('time_format', self.time_format)
+ self.set('date_format', self.date_format)
+ self.set('today_color', self.today_color)
+ self.set('future_color', self.future_color)
+ self.set('past_color', self.past_color)
+ self.set('show_news', self.show_news)
+ self.set('quick_label', self.quick_label)
+ self.set('quick_minutes', self.quick_minutes)
+ self.set('quick_popup', self.quick_popup)
+ self.set('quick_dialog', self.quick_dialog)
+ self.set('quick_sound', self.quick_sound)
+ self.set('quick_info', self.quick_info)
+ self.set('quick_slider', self.quick_slider)
+ self.set('quick_unit', self.quick_unit)
+ self.set('simple_popup', self.simple_popup)
+ self.set('simple_dialog', self.simple_dialog)
+ self.set('simple_sound', self.simple_sound)
+ self.set('boxcar_email', self.boxcar_email)
+ self.set('boxcar_notify', self.boxcar_notify)
+ self.set('pushbullet_api_key', self.pushbullet_api_key)
+ self.set('pushbullet_device', self.pushbullet_device)
+ self.set('pushbullet_devices', self.pushbullet_devices)
+ self.set('last_news', self.last_news)
+ self.set('new_news', self.new_news)
+
+ json.dump(self.dictionary, open(self.filename, 'w'))
+
+ def get(self, attr, default = None):
+ if attr not in self.dictionary:
+ self.set(attr, default)
+
+ return self.dictionary[attr]
+
+ def set(self, attr, value):
+ self.dictionary[attr] = value
+ setattr(self, attr, value)
+
+ def import_database(self):
+ if os.path.exists(self.database_filename):
+ db = Database(self.database_filename)
+ if (db.has_settings):
+ settings = db.settings()
+ boxcar_service = db.service('boxcar')
+
+ self.set('label', settings.label)
+ self.set('time', settings.time)
+ self.set('date', settings.date)
+ self.set('command', settings.command)
+ self.set('sound_file', settings.sound_file)
+ self.set('sound_play_length', settings.sound_length)
+ self.set('sound_loop', settings.sound_loop)
+ self.set('sound_loop_times', settings.sound_loop_times)
+ self.set('popup', settings.notification)
+ self.set('dialog', settings.dialog)
+ self.set('change_indicator', settings.change_icon)
+ self.set('hide_indicator', settings.hide_indicator)
+ self.set('indicator_icon', settings.indicator_icon)
+ self.set('postpone', settings.postpone)
+
+ self.set('time_format', settings.time_format)
+ self.set('date_format', settings.date_format)
+ self.set('today_color', settings.today_color)
+ self.set('future_color', settings.future_color)
+ self.set('past_color', settings.past_color)
+ self.set('show_news', settings.show_news)
+
+ self.set('quick_label', settings.quick_label)
+ self.set('quick_minutes', settings.quick_minutes)
+ self.set('quick_popup', settings.quick_popup)
+ self.set('quick_dialog', settings.quick_dialog)
+ self.set('quick_sound', settings.quick_sound)
+ self.set('quick_info', settings.quick_info)
+ self.set('quick_slider', settings.quick_slider)
+ self.set('quick_unit', settings.quick_unit)
+
+ self.set('boxcar_email', boxcar_service.email)
+ self.set('boxcar_notify', boxcar_service.default_notify)
- self.set('last_news', db.get_internal('news_flash'))
+ self.set('last_news', db.get_internal('news_flash'))
- db.delete_settings()
- self.dump()
+ db.delete_settings()
+ self.dump()
- db.close()
\ No newline at end of file
+ db.close()
diff -Nru remindor-common-13.08.2/remindor_common/constants.py remindor-common-14.01/remindor_common/constants.py
--- remindor-common-13.08.2/remindor_common/constants.py 2013-07-05 11:43:28.000000000 +0000
+++ remindor-common-14.01/remindor_common/constants.py 2013-10-22 11:36:58.000000000 +0000
@@ -36,7 +36,7 @@
config_path = os.path.expanduser('~') + '/.config/indicator-remindor'
if os.name == 'nt':
- config_path = os.getenv('APPDATA') + '/remindor'
+ config_path = os.getenv('APPDATA') + '/remindor'
database_file = config_path + '/indicator-remindor.db'
config_file = config_path + '/remindor.conf'
diff -Nru remindor-common-13.08.2/remindor_common/database.py remindor-common-14.01/remindor_common/database.py
--- remindor-common-13.08.2/remindor_common/database.py 2013-09-25 00:43:42.000000000 +0000
+++ remindor-common-14.01/remindor_common/database.py 2014-01-06 21:40:58.000000000 +0000
@@ -23,552 +23,562 @@
from remindor_common import datetimeutil
#def database_file():
- #return os.getenv('HOME') + '/.config/indicator-remindor/indicator-remindor.db'
+ #return os.getenv('HOME') + '/.config/indicator-remindor/indicator-remindor.db'
class Database():
- def __init__(self, filename):
- self.filename = filename
- directory = os.path.dirname(self.filename)
- if not os.path.exists(directory):
- os.makedirs(directory)
-
- migrate = False
- if not os.path.exists(filename):
- migrate = True
-
- self.connection = sqlite3.connect(filename)
- self.connection.text_factory = str
- self.cursor = self.connection.cursor()
-
- self.setup()
- if migrate:
- self.migrate_from_couch()
-
- if self.old_version < 9:
- self.fix_time_from_to()
-
- def setup(self):
- self.execute("""CREATE TABLE IF NOT EXISTS version (id INTEGER PRIMARY KEY AUTOINCREMENT,
- version TEXT)""")
- self.old_version = self.version()
- if self.old_version < 9:
- self.version(9)
-
- #00 - id
- #01 - label
- #02 - notes
- #03 - time
- #04 - date
- #05 - sound
- #06 - sound length
- #07 - sound loop
- #08 - popup notification
- #09 - command
- #10 - boxcar notification
- #11 - popup dialog
-
- self.execute("""CREATE TABLE IF NOT EXISTS alarms (id INTEGER PRIMARY KEY AUTOINCREMENT, label TEXT,
- notes TEXT, time TEXT, date TEXT, sound TEXT, sound_length INTEGER, sound_loop INTEGER,
- notification BOOLEAN, command TEXT, boxcar_notification BOOLEAN DEFAULT 0,
- dialog BOOLEAN DEFAULT 0)""")
-
- if self.old_version < 1:
- try:
- self.fetchone("SELECT boxcar_notification FROM alarms WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE alarms ADD COLUMN boxcar_notification BOOLEAN DEFAULT 0")
- if self.old_version < 2:
- try:
- self.fetchone("SELECT dialog FROM alarms WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE alarms ADD COLUMN dialog BOOLEAN DEFAULT 0")
-
- #00 - id
- #01 - label
- #02 - quick label
- #03 - time
- #04 - date
- #05 - command
- #06 - sound
- #07 - sound length
- #08 - sound loop
- #09 - sound loop times
- #10 - notification (popup)
- #11 - time format
- #12 - date format
- #13 - today color
- #14 - future color
- #15 - past color
- #16 - change indicator icon
- #17 - popup dialog
- #18 - postpone minutes
- #19 - quick minutes
- #20 - news notification
- #21 - quick reminder popup
- #22 - quick reminder dialog
- #23 - quick reminder use standard reminder sound
- #24 - quick show info on dialog
- #25 - hide indicator
- #26 - indicator icon index
- #27 - quick use slider
- #28 - quick time unit
-
- self.has_settings = (self.fetchone("SELECT name FROM sqlite_master WHERE type='table' AND name='settings'") != None)
-
- if self.has_settings:
- self.execute("""CREATE TABLE IF NOT EXISTS settings (id INTEGER PRIMARY KEY AUTOINCREMENT,
- label TEXT, quick_label TEXT, time TEXT, date TEXT, command TEXT, sound TEXT,
- sound_length INTEGER, sound_loop BOOLEAN, sound_loop_times INTEGER, notification BOOLEAN,
- time_format INTEGER, date_format INTEGER, today_color TEXT, future_color TEXT,
- past_color TEXT, indicator_icon BOOLEAN DEFAULT 1, dialog BOOLEAN DEFAULT 0,
- postpone INTEGER DEFAULT 30, quick_minutes INTEGER DEFAULT 30, news BOOLEAN DEFAULT 1,
- quick_popup BOOLEAN DEFAULT 1, quick_dialog BOOLEAN DEFAULT 0, quick_sound BOOLEAN DEFAULT 0,
- quick_info BOOLEAN DEFAULT 1, hide_indicator BOOLEAN DEFAULT 0,
- indicator_icon_index INTEGER DEFAULT 0, quick_slider BOOLEAN DEFAULT 1,
- quick_unit INTEGER DEFAULT 0)""")
-
- if self.old_version < 1:
- try:
- self.fetchone("SELECT indicator_icon FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN indicator_icon BOOLEAN DEFAULT 1")
- if self.old_version < 2:
- try:
- self.fetchone("SELECT dialog FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN dialog BOOLEAN DEFAULT 0")
- if self.old_version < 3:
- try:
- self.fetchone("SELECT postpone FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN postpone INTEGER DEFAULT 30")
-
- try:
- self.fetchone("SELECT quick_minutes FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN quick_minutes INTEGER DEFAULT 30")
- if self.old_version < 4:
- try:
- self.fetchone("SELECT news FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN news BOOLEAN DEFAULT 1")
- if self.old_version < 5:
- try:
- self.fetchone("SELECT quick_popup FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN quick_popup BOOLEAN DEFAULT 1")
- self.execute("ALTER TABLE settings ADD COLUMN quick_dialog BOOLEAN DEFAULT 0")
- self.execute("ALTER TABLE settings ADD COLUMN quick_sound BOOLEAN DEFAULT 0")
- self.execute("ALTER TABLE settings ADD COLUMN quick_info BOOLEAN DEFAULT 1")
- self.execute("ALTER TABLE settings ADD COLUMN hide_indicator BOOLEAN DEFAULT 0")
- if self.old_version < 6:
- try:
- self.fetchone("SELECT indicator_icon_index FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN indicator_icon_index INTEGER DEFAULT 0")
- if self.old_version < 7:
- try:
- self.fetchone("SELECT quick_slider FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN quick_slider BOOLEAN DEFAULT 1")
- if self.old_version < 8:
- try:
- self.fetchone("SELECT quick_unit FROM settings WHERE 1")
- except sqlite3.OperationalError:
- self.execute("ALTER TABLE settings ADD COLUMN quick_unit INTEGER DEFAULT 0")
-
- #00 - id
- #01 - type
- #02 - email
- #03 - secret
- #04 - default notify
-
- self.execute("""CREATE TABLE IF NOT EXISTS services (id INTEGER PRIMARY KEY AUTOINCREMENT,
- type TEXT, email TEXT, secret TEXT, default_notification BOOLEAN)""")
-
- #00 - id
- #01 - key
- #02 - value
-
- self.execute("""CREATE TABLE IF NOT EXISTS internal (id INTEGER PRIMARY KEY AUTOINCREMENT,
- key TEXT, value TEXT)""")
-
- row = self.fetchone('SELECT * FROM settings WHERE 1')
- if row == None:
- indicator_icon_index = 0
- #if os.name == 'nt':
- # indicator_icon_index = 3
-
- self.execute("""INSERT INTO settings (label, quick_label, time, date, command,
- sound, sound_length, sound_loop, sound_loop_times, notification, time_format,
- date_format, today_color, future_color, past_color, indicator_icon, dialog,
- postpone, quick_minutes, news, quick_popup, quick_dialog, quick_sound, quick_info,
- hide_indicator, indicator_icon_index, quick_slider, quick_unit)
- VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
- ["", _("Quick Reminder"), _("now"), _("today"), "", "", 10, False, 5, True, 0, 0,
- "#00007878ffff", "#04039e9e0000", "#ffffecec1f1f", True, False, 30, 30, True,
- True, False, False, True, False, indicator_icon_index, True, 0]
- )
-
- def fix_time_from_to(self):
- reminder_list = self.all_alarms()
- for reminder in reminder_list:
- new_time = datetimeutil.fix_time_from_to(reminder.time)
- if reminder.time != new_time and new_time != None:
- print reminder.time
- print new_time
- reminder.time = new_time
- self.delete_alarm(reminder.id)
- self.insert_alarm(reminder)
-
- def migrate_from_couch(self):
- try:
- from desktopcouch.records.server import CouchDatabase
- from desktopcouch.records.record import Record
- imported = True
- except ImportError:
- return
-
- db = 0
- try:
- db = CouchDatabase('indicator-remindor-alarms', create=False)
- except:
- return
-
- if not db.view_exists("list", "app"):
- map_js = """function(doc) { emit(doc._id, doc) }"""
- db.add_view("list", map_js, None, "app")
-
- result = db.execute_view("list", "app")
- result_list = list(result)
-
- for row in result_list:
- time_s = datetimeutil.format_time(row.value["hour"], row.value["minute"], row.value["am_pm"])
- sound_length = 0
- sound_loop = False
-
- try:
- sound_length = row.value["sound_length"]
- except KeyError:
- sound_length = 0
-
- try:
- sound_loop = row.value["sound_loop"]
- except KeyError:
- sound_loop = False
-
- self.execute("""INSERT INTO alarms (label, notes, time, date, sound, sound_length,
- sound_loop, notification, command) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)""",
- (row.value["label"], row.value["notes"], time_s, row.value["date"],
- row.value["sound"], sound_length, sound_loop,
- row.value["notification"], row.value["command"]))
-
- def delete_settings(self):
- self.execute('DROP TABLE settings')
- self.execute('DROP TABLE services')
- self.execute('DROP TABLE internal')
- self.has_settings = False
-
- def version(self, v=None):
- if v == None:
- row = self.fetchone("SELECT * FROM version WHERE 1")
-
- v = 0
- if row is not None:
- try:
- v = int(row[1])
- except:
- pass
-
- return v
- else:
- self.execute("DELETE FROM version WHERE 1")
- self.execute("INSERT INTO version (version) VALUES(?)", [str(v)])
-
- def execute(self, sql, data=None):
- if data == None:
- self.cursor.execute(sql)
- else:
- self.cursor.execute(sql, data)
-
- sql_list = sql.split(' ')
- if sql_list[0] != "SELECT":
- self.connection.commit()
-
- def fetchone(self, sql, data=None):
- self.execute(sql, data)
- return self.cursor.fetchone()
-
- def fetchall(self, sql, data=None):
- self.execute(sql, data)
- return self.cursor.fetchall()
-
- def close(self):
- self.connection.close()
-
- def alarm(self, id):
- row = self.fetchone("SELECT * FROM alarms WHERE id = ?", [str(id)])
- a = Alarm(-1)
- a.set_data_row(row)
- return a
-
- def all_alarms(self):
- result_list = self.fetchall("SELECT * FROM alarms")
- alarm_list = list()
- for row in result_list:
- a = Alarm(-1)
- a.set_data_row(row)
- alarm_list.append(a)
-
- return alarm_list
-
- def insert_alarm(self, a):
- sql = """INSERT INTO alarms (label, notes, time, date, sound,
- sound_length, sound_loop, notification, command, boxcar_notification,
- dialog) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"""
- data = a.get_data_row()
- self.execute(sql, data)
- return self.cursor.lastrowid
-
- def delete_alarm(self, id):
- self.execute("DELETE FROM alarms WHERE id = ?", [str(id)])
-
- def settings(self):
- if not self.has_settings:
- raise Exception('No settings to load!')
-
- row = self.fetchone("SELECT * FROM settings WHERE 1")
- return Settings(row)
-
- def set_settings(self, s):
- if not self.has_settings:
- raise Exception('No settings to set!')
-
- self.execute("DELETE FROM settings WHERE 1")
-
- sql = """INSERT INTO settings (label, quick_label, time, date, command,
- sound, sound_length, sound_loop, sound_loop_times, notification, time_format,
- date_format, today_color, future_color, past_color, indicator_icon, dialog,
- postpone, quick_minutes, news, quick_popup, quick_dialog, quick_sound, quick_info,
- hide_indicator, indicator_icon_index, quick_slider, quick_unit)
- VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"""
- data = s.get_data_row()
- self.execute(sql, data)
-
- return self.cursor.lastrowid
-
- def services(self):
- if not self.has_settings:
- raise Exception('No services to load!')
-
- rows = self.fetchall("SELECT * FROM services WHERE 1")
- return Services(rows)
-
- def service(self, type):
- if not self.has_settings:
- raise Exception('No services to load!')
-
- s = self.services()
- return s.service(type)
-
- def set_service(self, s):
- if not self.has_settings:
- raise Exception('No services to set!!')
-
- self.remove_service(s.type)
-
- sql = "INSERT INTO services (type, email, secret, default_notification) VALUES(?, ?, ?, ?)"
- data = s.get_data_row()
- self.execute(sql, data)
-
- return self.cursor.lastrowid
-
- def remove_service(self, type):
- if not self.has_settings:
- raise Exception('No services to remove!')
-
- self.execute("DELETE FROM services WHERE type = ?", [type])
-
- def get_internal(self, key):
- if not self.has_settings:
- raise Exception('No internals to load!')
-
- internal = self.fetchone("SELECT * FROM internal WHERE key = ?", [key])
-
- if internal != None:
- value = internal[2]
- else:
- value = None
-
- return value
-
- def set_internal(self, key, value):
- if not self.has_settings:
- raise Exception('No internals to set!')
+ def __init__(self, filename):
+ self.filename = filename
+ directory = os.path.dirname(self.filename)
+ if not os.path.exists(directory):
+ os.makedirs(directory)
+
+ migrate = False
+ if not os.path.exists(filename):
+ migrate = True
+
+ self.connection = sqlite3.connect(filename)
+ self.connection.text_factory = str
+ self.cursor = self.connection.cursor()
+
+ self.setup()
+ if migrate:
+ self.migrate_from_couch()
+
+ if self.old_version < 9:
+ self.fix_time_from_to()
+
+ def setup(self):
+ self.execute("""CREATE TABLE IF NOT EXISTS version (id INTEGER PRIMARY KEY AUTOINCREMENT,
+ version TEXT)""")
+ self.old_version = self.version()
+ if self.old_version < 10:
+ self.version(10)
+
+ #00 - id
+ #01 - label
+ #02 - notes
+ #03 - time
+ #04 - date
+ #05 - sound
+ #06 - sound length
+ #07 - sound loop
+ #08 - popup notification
+ #09 - command
+ #10 - boxcar notification
+ #11 - popup dialog
+ #12 - pushbullet device
+
+ self.execute("""CREATE TABLE IF NOT EXISTS alarms (id INTEGER PRIMARY KEY AUTOINCREMENT, label TEXT,
+ notes TEXT, time TEXT, date TEXT, sound TEXT, sound_length INTEGER, sound_loop INTEGER,
+ notification BOOLEAN, command TEXT, boxcar_notification BOOLEAN DEFAULT 0,
+ dialog BOOLEAN DEFAULT 0, pushbullet_device TEXT DEFAULT '')""")
+
+ if self.old_version < 1:
+ try:
+ self.fetchone("SELECT boxcar_notification FROM alarms WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE alarms ADD COLUMN boxcar_notification BOOLEAN DEFAULT 0")
+ if self.old_version < 2:
+ try:
+ self.fetchone("SELECT dialog FROM alarms WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE alarms ADD COLUMN dialog BOOLEAN DEFAULT 0")
+ if self.old_version < 10:
+ try:
+ self.fetchone('SELECT pushbullet_device FROM alarms WHERE 1')
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE alarms ADD COLUMN pushbullet_device TEXT DEFAULT ''")
+
+ #00 - id
+ #01 - label
+ #02 - quick label
+ #03 - time
+ #04 - date
+ #05 - command
+ #06 - sound
+ #07 - sound length
+ #08 - sound loop
+ #09 - sound loop times
+ #10 - notification (popup)
+ #11 - time format
+ #12 - date format
+ #13 - today color
+ #14 - future color
+ #15 - past color
+ #16 - change indicator icon
+ #17 - popup dialog
+ #18 - postpone minutes
+ #19 - quick minutes
+ #20 - news notification
+ #21 - quick reminder popup
+ #22 - quick reminder dialog
+ #23 - quick reminder use standard reminder sound
+ #24 - quick show info on dialog
+ #25 - hide indicator
+ #26 - indicator icon index
+ #27 - quick use slider
+ #28 - quick time unit
+
+ self.has_settings = (self.fetchone("SELECT name FROM sqlite_master WHERE type='table' AND name='settings'") != None)
+
+ if self.has_settings:
+ self.execute("""CREATE TABLE IF NOT EXISTS settings (id INTEGER PRIMARY KEY AUTOINCREMENT,
+ label TEXT, quick_label TEXT, time TEXT, date TEXT, command TEXT, sound TEXT,
+ sound_length INTEGER, sound_loop BOOLEAN, sound_loop_times INTEGER, notification BOOLEAN,
+ time_format INTEGER, date_format INTEGER, today_color TEXT, future_color TEXT,
+ past_color TEXT, indicator_icon BOOLEAN DEFAULT 1, dialog BOOLEAN DEFAULT 0,
+ postpone INTEGER DEFAULT 30, quick_minutes INTEGER DEFAULT 30, news BOOLEAN DEFAULT 1,
+ quick_popup BOOLEAN DEFAULT 1, quick_dialog BOOLEAN DEFAULT 0, quick_sound BOOLEAN DEFAULT 0,
+ quick_info BOOLEAN DEFAULT 1, hide_indicator BOOLEAN DEFAULT 0,
+ indicator_icon_index INTEGER DEFAULT 0, quick_slider BOOLEAN DEFAULT 1,
+ quick_unit INTEGER DEFAULT 0)""")
+
+ if self.old_version < 1:
+ try:
+ self.fetchone("SELECT indicator_icon FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN indicator_icon BOOLEAN DEFAULT 1")
+ if self.old_version < 2:
+ try:
+ self.fetchone("SELECT dialog FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN dialog BOOLEAN DEFAULT 0")
+ if self.old_version < 3:
+ try:
+ self.fetchone("SELECT postpone FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN postpone INTEGER DEFAULT 30")
+
+ try:
+ self.fetchone("SELECT quick_minutes FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN quick_minutes INTEGER DEFAULT 30")
+ if self.old_version < 4:
+ try:
+ self.fetchone("SELECT news FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN news BOOLEAN DEFAULT 1")
+ if self.old_version < 5:
+ try:
+ self.fetchone("SELECT quick_popup FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN quick_popup BOOLEAN DEFAULT 1")
+ self.execute("ALTER TABLE settings ADD COLUMN quick_dialog BOOLEAN DEFAULT 0")
+ self.execute("ALTER TABLE settings ADD COLUMN quick_sound BOOLEAN DEFAULT 0")
+ self.execute("ALTER TABLE settings ADD COLUMN quick_info BOOLEAN DEFAULT 1")
+ self.execute("ALTER TABLE settings ADD COLUMN hide_indicator BOOLEAN DEFAULT 0")
+ if self.old_version < 6:
+ try:
+ self.fetchone("SELECT indicator_icon_index FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN indicator_icon_index INTEGER DEFAULT 0")
+ if self.old_version < 7:
+ try:
+ self.fetchone("SELECT quick_slider FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN quick_slider BOOLEAN DEFAULT 1")
+ if self.old_version < 8:
+ try:
+ self.fetchone("SELECT quick_unit FROM settings WHERE 1")
+ except sqlite3.OperationalError:
+ self.execute("ALTER TABLE settings ADD COLUMN quick_unit INTEGER DEFAULT 0")
+
+ #00 - id
+ #01 - type
+ #02 - email
+ #03 - secret
+ #04 - default notify
+
+ self.execute("""CREATE TABLE IF NOT EXISTS services (id INTEGER PRIMARY KEY AUTOINCREMENT,
+ type TEXT, email TEXT, secret TEXT, default_notification BOOLEAN)""")
+
+ #00 - id
+ #01 - key
+ #02 - value
+
+ self.execute("""CREATE TABLE IF NOT EXISTS internal (id INTEGER PRIMARY KEY AUTOINCREMENT,
+ key TEXT, value TEXT)""")
+
+ row = self.fetchone('SELECT * FROM settings WHERE 1')
+ if row == None:
+ indicator_icon_index = 0
+ #if os.name == 'nt':
+ # indicator_icon_index = 3
+
+ self.execute("""INSERT INTO settings (label, quick_label, time, date, command,
+ sound, sound_length, sound_loop, sound_loop_times, notification, time_format,
+ date_format, today_color, future_color, past_color, indicator_icon, dialog,
+ postpone, quick_minutes, news, quick_popup, quick_dialog, quick_sound, quick_info,
+ hide_indicator, indicator_icon_index, quick_slider, quick_unit)
+ VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
+ ["", _("Quick Reminder"), _("now"), _("today"), "", "", 10, False, 5, True, 0, 0,
+ "#00007878ffff", "#04039e9e0000", "#ffffecec1f1f", True, False, 30, 30, True,
+ True, False, False, True, False, indicator_icon_index, True, 0]
+ )
+
+ def fix_time_from_to(self):
+ reminder_list = self.all_alarms()
+ for reminder in reminder_list:
+ new_time = datetimeutil.fix_time_from_to(reminder.time)
+ if reminder.time != new_time and new_time != None:
+ print reminder.time
+ print new_time
+ reminder.time = new_time
+ self.delete_alarm(reminder.id)
+ self.insert_alarm(reminder)
+
+ def migrate_from_couch(self):
+ try:
+ from desktopcouch.records.server import CouchDatabase
+ from desktopcouch.records.record import Record
+ imported = True
+ except ImportError:
+ return
+
+ db = 0
+ try:
+ db = CouchDatabase('indicator-remindor-alarms', create=False)
+ except:
+ return
+
+ if not db.view_exists("list", "app"):
+ map_js = """function(doc) { emit(doc._id, doc) }"""
+ db.add_view("list", map_js, None, "app")
+
+ result = db.execute_view("list", "app")
+ result_list = list(result)
+
+ for row in result_list:
+ time_s = datetimeutil.format_time(row.value["hour"], row.value["minute"], row.value["am_pm"])
+ sound_length = 0
+ sound_loop = False
+
+ try:
+ sound_length = row.value["sound_length"]
+ except KeyError:
+ sound_length = 0
+
+ try:
+ sound_loop = row.value["sound_loop"]
+ except KeyError:
+ sound_loop = False
+
+ self.execute("""INSERT INTO alarms (label, notes, time, date, sound, sound_length,
+ sound_loop, notification, command) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)""",
+ (row.value["label"], row.value["notes"], time_s, row.value["date"],
+ row.value["sound"], sound_length, sound_loop,
+ row.value["notification"], row.value["command"]))
+
+ def delete_settings(self):
+ self.execute('DROP TABLE settings')
+ self.execute('DROP TABLE services')
+ self.execute('DROP TABLE internal')
+ self.has_settings = False
+
+ def version(self, v=None):
+ if v == None:
+ row = self.fetchone("SELECT * FROM version WHERE 1")
+
+ v = 0
+ if row is not None:
+ try:
+ v = int(row[1])
+ except:
+ pass
+
+ return v
+ else:
+ self.execute("DELETE FROM version WHERE 1")
+ self.execute("INSERT INTO version (version) VALUES(?)", [str(v)])
+
+ def execute(self, sql, data=None):
+ if data == None:
+ self.cursor.execute(sql)
+ else:
+ self.cursor.execute(sql, data)
+
+ sql_list = sql.split(' ')
+ if sql_list[0] != "SELECT":
+ self.connection.commit()
+
+ def fetchone(self, sql, data=None):
+ self.execute(sql, data)
+ return self.cursor.fetchone()
+
+ def fetchall(self, sql, data=None):
+ self.execute(sql, data)
+ return self.cursor.fetchall()
+
+ def close(self):
+ self.connection.close()
+
+ def alarm(self, id):
+ row = self.fetchone("SELECT * FROM alarms WHERE id = ?", [str(id)])
+ a = Alarm(-1)
+ a.set_data_row(row)
+ return a
+
+ def all_alarms(self):
+ result_list = self.fetchall("SELECT * FROM alarms")
+ alarm_list = list()
+ for row in result_list:
+ a = Alarm(-1)
+ a.set_data_row(row)
+ alarm_list.append(a)
+
+ return alarm_list
+
+ def insert_alarm(self, a):
+ sql = """INSERT INTO alarms (label, notes, time, date, sound,
+ sound_length, sound_loop, notification, command, boxcar_notification,
+ dialog, pushbullet_device) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"""
+ data = a.get_data_row()
+ self.execute(sql, data)
+ return self.cursor.lastrowid
+
+ def delete_alarm(self, id):
+ self.execute("DELETE FROM alarms WHERE id = ?", [str(id)])
+
+ def settings(self):
+ if not self.has_settings:
+ raise Exception('No settings to load!')
+
+ row = self.fetchone("SELECT * FROM settings WHERE 1")
+ return Settings(row)
+
+ def set_settings(self, s):
+ if not self.has_settings:
+ raise Exception('No settings to set!')
+
+ self.execute("DELETE FROM settings WHERE 1")
+
+ sql = """INSERT INTO settings (label, quick_label, time, date, command,
+ sound, sound_length, sound_loop, sound_loop_times, notification, time_format,
+ date_format, today_color, future_color, past_color, indicator_icon, dialog,
+ postpone, quick_minutes, news, quick_popup, quick_dialog, quick_sound, quick_info,
+ hide_indicator, indicator_icon_index, quick_slider, quick_unit)
+ VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"""
+ data = s.get_data_row()
+ self.execute(sql, data)
+
+ return self.cursor.lastrowid
+
+ def services(self):
+ if not self.has_settings:
+ raise Exception('No services to load!')
+
+ rows = self.fetchall("SELECT * FROM services WHERE 1")
+ return Services(rows)
+
+ def service(self, type):
+ if not self.has_settings:
+ raise Exception('No services to load!')
+
+ s = self.services()
+ return s.service(type)
+
+ def set_service(self, s):
+ if not self.has_settings:
+ raise Exception('No services to set!!')
+
+ self.remove_service(s.type)
+
+ sql = "INSERT INTO services (type, email, secret, default_notification) VALUES(?, ?, ?, ?)"
+ data = s.get_data_row()
+ self.execute(sql, data)
+
+ return self.cursor.lastrowid
+
+ def remove_service(self, type):
+ if not self.has_settings:
+ raise Exception('No services to remove!')
+
+ self.execute("DELETE FROM services WHERE type = ?", [type])
+
+ def get_internal(self, key):
+ if not self.has_settings:
+ raise Exception('No internals to load!')
+
+ internal = self.fetchone("SELECT * FROM internal WHERE key = ?", [key])
+
+ if internal != None:
+ value = internal[2]
+ else:
+ value = None
+
+ return value
+
+ def set_internal(self, key, value):
+ if not self.has_settings:
+ raise Exception('No internals to set!')
- self.remove_internal(key)
- self.execute("INSERT INTO internal (key, value) VALUES(?, ?)", [key, value])
+ self.remove_internal(key)
+ self.execute("INSERT INTO internal (key, value) VALUES(?, ?)", [key, value])
- return self.cursor.lastrowid
+ return self.cursor.lastrowid
- def remove_internal(self, key):
- self.execute("DELETE FROM internal WHERE key = ?", [key])
+ def remove_internal(self, key):
+ self.execute("DELETE FROM internal WHERE key = ?", [key])
class Alarm():
- def __init__(self, id):
- self.id = id
- self.label = ""
- self.notes = ""
- self.time = "now"
- self.date = "today"
- self.sound_file = ""
- self.sound_length = 0
- self.sound_loop = True
- self.notification = True
- self.command = ""
- self.boxcar = False
- self.dialog = False
-
- def set_data_row(self, row):
- if row != None:
- self.id = row[0]
- self.label = row[1]
- self.notes = row[2]
- self.time = row[3]
- self.date = row[4]
- self.sound_file = row[5]
- self.sound_length = row[6]
- self.sound_loop = row[7]
- self.notification = row[8]
- self.command = row[9]
- self.boxcar = row[10]
- self.dialog = row[11]
-
- def set_data(self, label, notes, time, date, sound_file, sound_length, sound_loop,
- notification, command, boxcar, dialog):
- self.label = label
- self.notes = notes
- self.time = time
- self.date = date
- self.sound_file = sound_file
- self.sound_length = sound_length
- self.sound_loop = sound_loop
- self.notification = notification
- self.command = command
- self.boxcar = boxcar
- self.dialog = dialog
-
- def get_data_row(self):
- row = list()
- #row[0] = self.id
- row.append(self.label)
- row.append(self.notes)
- row.append(self.time)
- row.append(self.date)
- row.append(self.sound_file)
- row.append(self.sound_length)
- row.append(self.sound_loop)
- row.append(self.notification)
- row.append(self.command)
- row.append(self.boxcar)
- row.append(self.dialog)
-
- return row
-
- def get_data(self):
- return (self.id, self.label, self.notes, self.time, self.date, self.sound_file,
- self.sound_length, self.sound_loop, self.notification, self.command,
- self.boxcar, self.dialog)
+ def __init__(self, id):
+ self.id = id
+ self.label = ""
+ self.notes = ""
+ self.time = "now"
+ self.date = "today"
+ self.sound_file = ""
+ self.sound_length = 0
+ self.sound_loop = True
+ self.notification = True
+ self.command = ""
+ self.boxcar = False
+ self.dialog = False
+ self.pushbullet_device = ''
+
+ def set_data_row(self, row):
+ if row != None:
+ self.id = row[0]
+ self.label = row[1]
+ self.notes = row[2]
+ self.time = row[3]
+ self.date = row[4]
+ self.sound_file = row[5]
+ self.sound_length = row[6]
+ self.sound_loop = row[7]
+ self.notification = row[8]
+ self.command = row[9]
+ self.boxcar = row[10]
+ self.dialog = row[11]
+ self.pushbullet_device = row[12]
+
+ def set_data(self, label, notes, time, date, sound_file, sound_length, sound_loop,
+ notification, command, boxcar, dialog, pushbullet_device):
+ self.label = label
+ self.notes = notes
+ self.time = time
+ self.date = date
+ self.sound_file = sound_file
+ self.sound_length = sound_length
+ self.sound_loop = sound_loop
+ self.notification = notification
+ self.command = command
+ self.boxcar = boxcar
+ self.dialog = dialog
+ self.pushbullet_device = pushbullet_device
+
+ def get_data_row(self):
+ row = list()
+ #row[0] = self.id
+ row.append(self.label)
+ row.append(self.notes)
+ row.append(self.time)
+ row.append(self.date)
+ row.append(self.sound_file)
+ row.append(self.sound_length)
+ row.append(self.sound_loop)
+ row.append(self.notification)
+ row.append(self.command)
+ row.append(self.boxcar)
+ row.append(self.dialog)
+ row.append(self.pushbullet_device)
+
+ return row
+
+ def get_data(self):
+ return (self.id, self.label, self.notes, self.time, self.date, self.sound_file,
+ self.sound_length, self.sound_loop, self.notification, self.command,
+ self.boxcar, self.dialog, self.pushbullet_device)
class Settings():
- def __init__(self, row):
- self.id = row[0]
- self.label = row[1]
- self.quick_label = row[2]
- self.time = row[3]
- self.date = row[4]
- self.command = row[5]
- self.sound_file = row[6]
- self.sound_length = row[7]
- self.sound_loop = row[8]
- self.sound_loop_times = row[9]
- self.notification = row[10]
- self.time_format = row[11]
- self.date_format = row[12]
- self.today_color = row[13]
- self.future_color = row[14]
- self.past_color = row[15]
- self.change_icon = row[16]
- self.dialog = row[17]
- self.postpone = row[18]
- self.quick_minutes = row[19]
- self.show_news = row[20]
- self.quick_popup = row[21]
- self.quick_dialog = row[22]
- self.quick_sound = row[23]
- self.quick_info = row[24]
- self.hide_indicator = row[25]
- self.indicator_icon = row[26]
- self.quick_slider = row[27]
- self.quick_unit = row[28]
-
- def get_data_row(self):
- row = list()
- row.append(self.label)
- row.append(self.quick_label)
- row.append(self.time)
- row.append(self.date)
- row.append(self.command)
- row.append(self.sound_file)
- row.append(self.sound_length)
- row.append(self.sound_loop)
- row.append(self.sound_loop_times)
- row.append(self.notification)
- row.append(self.time_format)
- row.append(self.date_format)
- row.append(self.today_color)
- row.append(self.future_color)
- row.append(self.past_color)
- row.append(self.change_icon)
- row.append(self.dialog)
- row.append(self.postpone)
- row.append(self.quick_minutes)
- row.append(self.show_news)
- row.append(self.quick_popup)
- row.append(self.quick_dialog)
- row.append(self.quick_sound)
- row.append(self.quick_info)
- row.append(self.hide_indicator)
- row.append(self.indicator_icon)
- row.append(self.quick_slider)
- row.append(self.quick_unit)
+ def __init__(self, row):
+ self.id = row[0]
+ self.label = row[1]
+ self.quick_label = row[2]
+ self.time = row[3]
+ self.date = row[4]
+ self.command = row[5]
+ self.sound_file = row[6]
+ self.sound_length = row[7]
+ self.sound_loop = row[8]
+ self.sound_loop_times = row[9]
+ self.notification = row[10]
+ self.time_format = row[11]
+ self.date_format = row[12]
+ self.today_color = row[13]
+ self.future_color = row[14]
+ self.past_color = row[15]
+ self.change_icon = row[16]
+ self.dialog = row[17]
+ self.postpone = row[18]
+ self.quick_minutes = row[19]
+ self.show_news = row[20]
+ self.quick_popup = row[21]
+ self.quick_dialog = row[22]
+ self.quick_sound = row[23]
+ self.quick_info = row[24]
+ self.hide_indicator = row[25]
+ self.indicator_icon = row[26]
+ self.quick_slider = row[27]
+ self.quick_unit = row[28]
+
+ def get_data_row(self):
+ row = list()
+ row.append(self.label)
+ row.append(self.quick_label)
+ row.append(self.time)
+ row.append(self.date)
+ row.append(self.command)
+ row.append(self.sound_file)
+ row.append(self.sound_length)
+ row.append(self.sound_loop)
+ row.append(self.sound_loop_times)
+ row.append(self.notification)
+ row.append(self.time_format)
+ row.append(self.date_format)
+ row.append(self.today_color)
+ row.append(self.future_color)
+ row.append(self.past_color)
+ row.append(self.change_icon)
+ row.append(self.dialog)
+ row.append(self.postpone)
+ row.append(self.quick_minutes)
+ row.append(self.show_news)
+ row.append(self.quick_popup)
+ row.append(self.quick_dialog)
+ row.append(self.quick_sound)
+ row.append(self.quick_info)
+ row.append(self.hide_indicator)
+ row.append(self.indicator_icon)
+ row.append(self.quick_slider)
+ row.append(self.quick_unit)
- return row
+ return row
class Services():
- def __init__(self, rows):
- self.dictionary = dict()
- for row in rows:
- self.dictionary[row[1]] = Service(row[1], row[2], row[3], row[4])
-
- def service(self, type):
- try:
- return self.dictionary[type]
- except KeyError:
- return Service(type, "", "", False)
+ def __init__(self, rows):
+ self.dictionary = dict()
+ for row in rows:
+ self.dictionary[row[1]] = Service(row[1], row[2], row[3], row[4])
+
+ def service(self, type):
+ try:
+ return self.dictionary[type]
+ except KeyError:
+ return Service(type, "", "", False)
class Service():
- def __init__(self, type, email, secret, default_notify):
- self.type = type
- self.email = email
- self.secret = secret
- self.default_notify = default_notify
-
- def get_data_row(self):
- row = list()
- row.append(self.type)
- row.append(self.email)
- row.append(self.secret)
- row.append(self.default_notify)
+ def __init__(self, type, email, secret, default_notify):
+ self.type = type
+ self.email = email
+ self.secret = secret
+ self.default_notify = default_notify
+
+ def get_data_row(self):
+ row = list()
+ row.append(self.type)
+ row.append(self.email)
+ row.append(self.secret)
+ row.append(self.default_notify)
- return row
+ return row
diff -Nru remindor-common-13.08.2/remindor_common/datetimeutil.py remindor-common-14.01/remindor_common/datetimeutil.py
--- remindor-common-13.08.2/remindor_common/datetimeutil.py 2013-10-14 00:49:59.000000000 +0000
+++ remindor-common-14.01/remindor_common/datetimeutil.py 2013-10-22 11:37:43.000000000 +0000
@@ -681,33 +681,33 @@
if len(dl) == 2:
#every , every , every day, every other, next
- unit = date_unit_replace(dl[1])
- if dl[0] == 'every' and unit in date_units:
- x = 1
- if unit == 'week':
- x = 7
- elif unit == 'month':
- x = 30
- elif unit == 'year':
- x = 365
-
- dl = ['every', str(x), 'days']
- else:
- if dl[0] not in first_only:
- return None
- elif is_number(dl[1]) and not is_day_of_month(dl[1]):
- #number is not a valid day of the month
- return None
- elif not is_number(dl[1]) and dl[1] not in days and dl[1] not in second_only:
- return None
- elif dl[0] == "next":
- #next is actually a singular date!
- return None
- '''if from_s != None:
- #can't have from/to with next
- return None
- elif not is_number(dl[1]):
- #non number after next
+ unit = date_unit_replace(dl[1])
+ if dl[0] == 'every' and unit in date_units:
+ x = 1
+ if unit == 'week':
+ x = 7
+ elif unit == 'month':
+ x = 30
+ elif unit == 'year':
+ x = 365
+
+ dl = ['every', str(x), 'days']
+ else:
+ if dl[0] not in first_only:
+ return None
+ elif is_number(dl[1]) and not is_day_of_month(dl[1]):
+ #number is not a valid day of the month
+ return None
+ elif not is_number(dl[1]) and dl[1] not in days and dl[1] not in second_only:
+ return None
+ elif dl[0] == "next":
+ #next is actually a singular date!
+ return None
+ '''if from_s != None:
+ #can't have from/to with next
+ return None
+ elif not is_number(dl[1]):
+ #non number after next
return None'''
if d == "every other":
diff -Nru remindor-common-13.08.2/remindor_common/dbus_service.py remindor-common-14.01/remindor_common/dbus_service.py
--- remindor-common-13.08.2/remindor_common/dbus_service.py 2013-06-13 11:42:23.000000000 +0000
+++ remindor-common-14.01/remindor_common/dbus_service.py 2013-10-22 11:37:47.000000000 +0000
@@ -72,4 +72,4 @@
return self._interface
except:
- logger.debug('Unable to initialize dbus in remindor_common.dbus_service, this features will be disabled')
\ No newline at end of file
+ logger.debug('Unable to initialize dbus in remindor_common.dbus_service, this features will be disabled')
diff -Nru remindor-common-13.08.2/remindor_common/helpers.py remindor-common-14.01/remindor_common/helpers.py
--- remindor-common-13.08.2/remindor_common/helpers.py 2013-08-30 11:12:41.000000000 +0000
+++ remindor-common-14.01/remindor_common/helpers.py 2014-01-13 15:30:08.000000000 +0000
@@ -29,13 +29,15 @@
logger = logging.getLogger('remindor_common')
from remindor_common.config import Config
-from remindor_common import database as db, datetimeutil, services
+from remindor_common import database as db, datetimeutil
from remindor_common.datetimeutil import *
from remindor_common import version
+from remindor_common.services.boxcar import Boxcar
+from remindor_common.services.pushbullet import Pushbullet, PushbulletException
insert_values = ["+date+", "+month+", "+monthname+", "+day+", "+dayname+", "+yearday+",
- "+year+", "+time+", "+hour+", "+hour12+", "+minute+", "+second+",
- "+microsecond+", "+soundfullfile+", "+soundfile+", "+command+"]
+ "+year+", "+time+", "+hour+", "+hour12+", "+minute+", "+second+",
+ "+microsecond+", "+soundfullfile+", "+soundfile+", "+command+"]
#based on http://stackoverflow.com/a/214657
def hex_to_rgb(value):
@@ -61,14 +63,24 @@
return datetimeutil.str_date_simplify(date_s, date_format) != None
def data_dir():
- path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/'))
- if not os.path.exists(path):
- path = os.path.join(sys.prefix, 'share/remindor-common')
+ path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/'))
+ if not os.path.exists(path):
+ path = os.path.join(sys.prefix, 'share/remindor-common')
- return path
+ return path
def data_file(*path_parts):
- return os.path.join(data_dir(), *path_parts)
+ return os.path.join(data_dir(), *path_parts)
+
+def is_number(s):
+ try:
+ int(s)
+ return True
+ except:
+ return False
+
+def is_string(s):
+ return isinstance(s, basestring)
def parse_options(main_version):
usage = _("usage: %prog [option]")
@@ -134,9 +146,75 @@
lib_logger.addHandler(lib_logger_sh)
lib_logger.debug('extra verbose mode')
- logger.debug('%s version %s' % (os.path.basename(sys.argv[0]), main_version))
+ logger.debug('%s version %s' % (os.path.basename(sys.argv[0]), main_version))
logger.debug('remindor-common version ' + version())
+class PushbulletInfo():
+ pushbullet_delete = 'pushbullet delete'
+ pushbullet_add = 'pushbullet add'
+ pushbullet_invalid = 'pushbullet invalid'
+ pushbullet_error = 'pushbullet error'
+ pushbullet_retry = 'pushbullet retry'
+
+ pushbullet_devices_updated = False
+
+ def get_pushbullet_index(self, default = None):
+ if default == None:
+ default = self.settings.pushbullet_device
+
+ index = 0
+ if self.settings.pushbullet_api_key != '' and default != '':
+ count = 1
+ for device in self.settings.pushbullet_devices:
+ if str(device['id']) == str(default):
+ index = count
+
+ count += 1
+
+ return index
+
+ def get_pushbullet_id(self, index, devices):
+ value = ''
+ if devices:
+ value = devices[(index - 1)]['id']
+ if index == 0:
+ value = ''
+
+ return value
+
+ def refresh_pushbullet_devices(self, api_key):
+ value = self.pushbullet_error
+
+ if api_key == '':
+ self.settings.pushbullet_devices = []
+ value = self.pushbullet_delete
+ else:
+ p = Pushbullet(api_key)
+ devices = None
+ status = 200
+ try:
+ devices = p.devices()
+ except PushbulletException as e:
+ devices = None
+ status = e.status
+
+ if status == 200:
+ self.settings.pushbullet_devices = devices
+ self.pushbullet_devices = devices
+ self.pushbullet_devices_updated = True
+ #devices.insert(0, {'id': -1, 'name': 'None'}) #Do this in the gui code
+ self.pushbullet_device_index = self.get_pushbullet_index()
+
+ value = devices
+ elif status == 401 or status == 403:
+ value = self.pushbullet_invalid
+ elif status >= 500 and status < 600:
+ value = self.pushbullet_retry
+ else:
+ value = self.pushbullet_error
+
+ return value
+
class QuickDialogInfo():
def __init__(self, file):
self.file = file
@@ -191,7 +269,7 @@
a = db.Alarm(-1)
a.set_data(label, "", time_s, date_s, sound_file, sound_length, sound_loop, \
- self.settings.quick_popup, "", False, self.settings.quick_dialog)
+ self.settings.quick_popup, "", False, self.settings.quick_dialog, '')
self.database = db.Database(self.file)
id = self.database.insert_alarm(a)
@@ -225,7 +303,7 @@
r = db.Alarm(-1)
r.set_data(label, "", time_s, date_s, sound_file, sound_length, sound_loop, \
- self.settings.simple_popup, "", False, self.settings.simple_dialog)
+ self.settings.simple_popup, "", False, self.settings.simple_dialog, '')
self.database = db.Database(self.file)
id = self.database.insert_alarm(r)
@@ -334,6 +412,12 @@
if not a.boxcar:
boxcar_notify = _("No")
+ pushbullet_device = 'None'
+ if a.pushbullet_device != '':
+ for device in self.settings.pushbullet_devices:
+ if str(device['id']) == str(a.pushbullet_device):
+ pushbullet_device = device['name']
+
note = a.notes.replace("\n", "/ ")
if len(a.notes) > 50:
note = a.notes[:50] + "..."
@@ -346,7 +430,7 @@
if a.command == "" or a.command == None:
command = _("None")
- tooltip = "%s: %s\n%s: %s\n%s: %s\nBoxcar: %s\n%s: %s" % (_("Sound"), sound, _("Notification"), notify, _("Dialog"), dialog, boxcar_notify, _("Command"), command)
+ tooltip = "%s: %s\n%s: %s\n%s: %s\nBoxcar: %s\nPushbullet: %s\n%s: %s" % (_("Sound"), sound, _("Notification"), notify, _("Dialog"), dialog, boxcar_notify, pushbullet_device, _("Command"), command)
time_s2 = fix_time_format(a.time, self.settings.time_format)
date_s2 = fix_date_format(a.date, self.settings.date_format)
@@ -378,7 +462,7 @@
def qt(self):
return [self.label, self.time, self.date, self.note, self.id]
-class ReminderDialogInfo():
+class ReminderDialogInfo(PushbulletInfo):
ok = 0
time_error = 1
date_error = 2
@@ -402,6 +486,11 @@
self.dialog = self.settings.dialog
self.boxcar = self.settings.boxcar_notify
self.boxcar_ok = self.settings.boxcar_email != ''
+ self.pushbullet_api_key = self.settings.pushbullet_api_key
+ self.pushbullet_device = self.settings.pushbullet_device
+ self.pushbullet_devices = self.settings.pushbullet_devices
+ self.pushbullet_ok = self.settings.pushbullet_api_key != ''
+ self.pushbullet_device_index = self.get_pushbullet_index()
self.sound_file = self.settings.sound_file
self.sound_length = self.settings.sound_play_length
self.sound_loop = self.settings.sound_loop
@@ -415,7 +504,7 @@
self.play_sound = True
def reminder(self, label, time, date, command, notes, popup, dialog, boxcar, play,
- sound_file, sound_length, sound_loop, delete_id, check_warning = False):
+ sound_file, sound_length, sound_loop, pushbullet_device, delete_id, check_warning = False):
time = datetimeutil.str_time_simplify(time)
if time == None:
return (self.time_error, -1)
@@ -433,7 +522,7 @@
except IOError as e:
return (self.file_error, -1)
- if label == "" and notes == "" and check_warning and (boxcar or popup or dialog):
+ if label == "" and notes == "" and check_warning and (boxcar or popup or dialog or pushbullet_device):
return (self.notify_warn, -1)
if not play:
@@ -443,7 +532,7 @@
r = db.Alarm(-1)
r.set_data(label, notes, time, date, sound_file, sound_length, sound_loop,
- popup, command, boxcar, dialog)
+ popup, command, boxcar, dialog, pushbullet_device)
self.database = db.Database(self.filename)
id = self.database.insert_alarm(r)
@@ -453,6 +542,9 @@
self.database.close()
+ if self.pushbullet_devices_updated:
+ self.settings.dump()
+
return (self.ok, id)
class TimeDialogInfo():
@@ -713,7 +805,7 @@
return datetimeutil.date_to_local(value.lower())
-class PreferencesDialogInfo():
+class PreferencesDialogInfo(PushbulletInfo):
ok = 0
time_error = 1
date_error = 2
@@ -739,6 +831,8 @@
self.qt_date_format = qt_date_formats[self.settings.date_format]
self.date_format_num = self.settings.date_format
+ self.pushbullet_device_index = self.get_pushbullet_index()
+
def preferences(self, settings):
if not valid_time(settings.time):
return self.time_error
@@ -753,7 +847,7 @@
return_status = self.boxcar_add
if boxcar_email != boxcar_original and boxcar_email != "":
- status = services.boxcar_subscribe(boxcar_email)
+ status = Boxcar(boxcar_email).subscribe()
if status == 404: #user not in system
return_status = self.boxcar_subscribe
elif status == 200 or status == 401: #ok or user already subscribed
@@ -764,4 +858,4 @@
elif boxcar_email == "":
return_status = self.boxcar_delete
- return return_status
\ No newline at end of file
+ return return_status
diff -Nru remindor-common-13.08.2/remindor_common/scheduler.py remindor-common-14.01/remindor_common/scheduler.py
--- remindor-common-13.08.2/remindor_common/scheduler.py 2013-09-25 12:45:00.000000000 +0000
+++ remindor-common-14.01/remindor_common/scheduler.py 2014-01-01 14:10:13.000000000 +0000
@@ -20,6 +20,8 @@
from remindor_common import database as db
from remindor_common.datetimeutil import timestamp, format_time, str_to_date, is_time_repeating, format_time3, is_date_repeating, fix_time_format, fix_date_format, internal_date_format, internal_time_format, time_formats, date_formats
from remindor_common.threads import RunCommand
+from remindor_common.services.boxcar import Boxcar
+from remindor_common.services.pushbullet import Pushbullet
import subprocess, shlex
from os.path import basename
@@ -60,12 +62,12 @@
raise NotImplementedError("Need to implement change_icon!")
def run_command(self, command):
- logger.debug("scheduler: run_command")
+ logger.debug("scheduler: run_command")
- rc = RunCommand(command, self.config_dir)
- rc.run()
+ rc = RunCommand(command, self.config_dir)
+ rc.run()
- logger.debug("scheduler: done run_command")
+ logger.debug("scheduler: done run_command")
def play_sound(self, sound_file, sound_loop, sound_length):
logger.debug("scheduler: play_sound")
@@ -114,10 +116,13 @@
def popup_dialog(self, label, notes):
raise NotImplementedError("Need to implement popup_dialog!")
- def run_boxcar(self, boxcar_email, label, notes):
- logger.debug("scheduler: run_boxcar")
- status = services.boxcar_notify(boxcar_email, label, notes)
- logger.debug("scheduler: done run_boxcar: " + str(status))
+ def run_boxcar(self, boxcar_email, label, notes):
+ logger.debug("scheduler: run_boxcar")
+ Boxcar(boxcar_email).notify(label, notes)
+
+ def run_pushbullet(self, pushbullet_api_key, pushbullet_device, label, notes):
+ logger.debug("scheduler: run_pushbullet")
+ status = Pushbullet(pushbullet_api_key).note(pushbullet_device, label, notes)
def run_alarm(self, id):
logger.debug("scheduler: run_alarm: " + str(id))
@@ -159,6 +164,9 @@
if a.boxcar and settings.boxcar_email != "":
self.run_boxcar(settings.boxcar_email, a.label, notes)
+ if a.pushbullet_device and settings.pushbullet_api_key:
+ self.run_pushbullet(settings.pushbullet_api_key, a.pushbullet_device, a.label, notes)
+
self.update_schedule()
logger.debug("scheduler: done run_alarm")
@@ -211,4 +219,4 @@
note = note.replace("+soundfile+", basename(sound_file))
note = note.replace("+command+", command)
- return note
\ No newline at end of file
+ return note
diff -Nru remindor-common-13.08.2/remindor_common/services/__init__.py remindor-common-14.01/remindor_common/services/__init__.py
--- remindor-common-13.08.2/remindor_common/services/__init__.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/remindor_common/services/__init__.py 2013-12-22 14:15:46.000000000 +0000
@@ -0,0 +1,15 @@
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+### BEGIN LICENSE
+# Copyright (C) 2013 Brian Douglass bhdouglass@gmail.com
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+### END LICENSE
diff -Nru remindor-common-13.08.2/remindor_common/services/boxcar.py remindor-common-14.01/remindor_common/services/boxcar.py
--- remindor-common-13.08.2/remindor_common/services/boxcar.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/remindor_common/services/boxcar.py 2014-01-01 14:34:59.000000000 +0000
@@ -0,0 +1,53 @@
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+### BEGIN LICENSE
+# Copyright (C) 2013 Brian Douglass bhdouglass@gmail.com
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+### END LICENSE
+
+import requests
+import sys
+
+import logging
+logger = logging.getLogger('remindor_common')
+
+from remindor_common.services.post import Post
+
+class Boxcar():
+ api_key = '2KXkozIJdhwT9tyvukKf'
+ api_url = 'http://boxcar.io/devices/providers/'
+ ir_url = 'http://bhdouglass.tk/remindor/'
+ icon_url = 'http://bhdouglass.tk/assets/img/ir_iphone_57.png'
+ email = ''
+
+ def __init__(self, email):
+ self.email = email
+
+ def subscribe(self):
+ #probably shouldn't thread this, we need to know if it fails or not
+ status = -1
+ try:
+ r = requests.post(self.build_url('/notifications/subscribe'), params={'email': self.email})
+ status = r.status_code
+ except:
+ logger.debug('exception caught trying subscribe to boxcar: ' + str(sys.exc_info()[0]))
+
+ return status
+
+ def notify(self, screen_name, message, callback = None, err_callback = None):
+ data = {'email': self.email, 'notification[from_screen_name]': screen_name,
+ 'notification[message]': message, 'notification[source_url]': self.ir_url}
+ b = Post(self.build_url('/notifications'), data)
+ b.start()
+
+ def build_url(self, route):
+ return self.api_url + self.api_key + route
diff -Nru remindor-common-13.08.2/remindor_common/services/post.py remindor-common-14.01/remindor_common/services/post.py
--- remindor-common-13.08.2/remindor_common/services/post.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/remindor_common/services/post.py 2014-01-13 15:19:12.000000000 +0000
@@ -0,0 +1,57 @@
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+### BEGIN LICENSE
+# Copyright (C) 2013 Brian Douglass bhdouglass@gmail.com
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+### END LICENSE
+
+import threading
+import sys
+import requests
+
+import logging
+logger = logging.getLogger('remindor_common')
+
+class Post(threading.Thread):
+ def __init__(self, url, data = None, auth = None, files = None, callback = None, err_callback = None):
+ threading.Thread.__init__(self)
+ self.url = url
+ self.data = data
+ self.auth = auth
+ self.files = files
+ self.callback = callback
+ self.err_callback = err_callback
+
+ self.headers = {}
+ if requests.__version__ < '1.1.0':
+ self.headers = {'Content-Length': '0'} #for old versions of requests
+
+ def run(self):
+ status = -1
+ r = None
+ logger.debug("sending post request to: " + self.url)
+ try:
+ r = requests.post(self.url, params=self.data, auth=self.auth, files=self.files, headers=self.headers)
+ logger.debug("Post request content: " + r.content)
+ status = r.status_code
+ except:
+ logger.warning("Exception caught trying post request: " + str(sys.exc_info()[0]))
+
+ logger.debug("Post request status: " + str(status))
+
+ if status != 200:
+ if self.err_callback is None:
+ raise Exception('%d response recieved while posting to %s' % (status, self.url))
+ else:
+ self.err_callback(status)
+ elif self.callback is not None:
+ self.callback(r)
diff -Nru remindor-common-13.08.2/remindor_common/services/pushbullet.py remindor-common-14.01/remindor_common/services/pushbullet.py
--- remindor-common-13.08.2/remindor_common/services/pushbullet.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/remindor_common/services/pushbullet.py 2014-01-13 13:02:20.000000000 +0000
@@ -0,0 +1,135 @@
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+### BEGIN LICENSE
+# Copyright (C) 2013 Brian Douglass bhdouglass@gmail.com
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+### END LICENSE
+
+import requests
+import sys
+import json
+
+import logging
+logger = logging.getLogger('remindor_common')
+
+from remindor_common.services.post import Post
+
+class PushbulletException(Exception):
+ def __init__(self, status, message = ''):
+ self.status = status
+
+ if message == '':
+ self.message = ''
+ if status == -1:
+ self.message = 'Error making request'
+ elif status == 400:
+ self.message = 'Bad Request'
+ elif status == 401:
+ self.message = 'Invalid api key provided'
+ elif status == 402:
+ self.message = 'Request Failed'
+ elif status == 403:
+ self.message = 'Invalid api key for this request'
+ elif status == 404:
+ self.message = 'Not found'
+ elif status >= 500 and status < 600:
+ self.message = 'Pushbullet Server error'
+ else:
+ self.message = 'Unkown error'
+ else:
+ self.message = message
+
+ logger.debug('Pushbullet Exception: %s (%s)' % (self.message, self.status))
+
+ def __str__(self):
+ return repr('%s (%s)' % (self.message, self.status))
+
+class Pushbullet():
+ api_base = 'https://api.pushbullet.com/api/'
+ api_key = ''
+ api_auth = ('', '')
+
+ def __init__(self, api_key):
+ self.api_key = api_key
+ self.api_auth = (self.api_key, '')
+
+ def devices(self):
+ devices = []
+ status = -1
+
+ try:
+ r = requests.get(self.api_base + 'devices', auth=self.api_auth)
+ status = r.status_code
+ except:
+ logger.debug("exception caught trying get device list: " + str(sys.exc_info()[0]))
+
+ if status == 200:
+ #response = r.json()
+ #old versions of requests didn't have the json method
+ response = json.loads(r.content)
+
+ for device in response['devices']:
+ devices.append({
+ 'id': device['id'],
+ 'name': device['extras']['nickname']
+ })
+ for friend in response['shared_devices']:
+ devices.append({
+ 'id': friend['id'],
+ 'name': friend['owner_name']
+ })
+ else:
+ raise PushbulletException(status)
+
+ return devices
+
+ def push(self, device, type, param1, param2 = None, callback = None, err_callback = None):
+ data = {
+ 'device_id': device,
+ 'type': type
+ }
+ files = None
+
+ if type == 'note':
+ data['title'] = param1
+ data['body'] = param2
+ elif type == 'link':
+ data['title'] = param1
+ data['url'] = param2
+ elif type == 'address':
+ data['name'] = param1
+ data['address'] = param2
+ elif type == 'list':
+ data['title'] = param1
+ data['list'] = param2
+ #elif type == 'file':
+ # files = {file: open(param1)}
+ else:
+ raise PushbulletException(-1, 'Invalid push type specified')
+
+ p = Post(self.api_base + 'pushes', data=data, auth=self.api_auth, files=files, callback=callback, err_callback=err_callback)
+ p.start()
+
+ def note(self, device, title, body):
+ self.push(device, 'note', title, body)
+
+ def link(self, device, title, url):
+ self.push(device, 'link', title, url)
+
+ def address(self, device, name, address):
+ self.push(device, 'address', name, address)
+
+ def list(self, device, title, list):
+ self.push(device, 'list', title, list)
+
+ #def file(self, device, file):
+ #self.push(device, 'file', file)
diff -Nru remindor-common-13.08.2/remindor_common/services.py remindor-common-14.01/remindor_common/services.py
--- remindor-common-13.08.2/remindor_common/services.py 2013-07-26 18:15:15.000000000 +0000
+++ remindor-common-14.01/remindor_common/services.py 2013-12-22 13:13:37.000000000 +0000
@@ -59,4 +59,4 @@
except:
logger.debug("exception caught trying send boxcar notification")
- return status'''
\ No newline at end of file
+ return status'''
diff -Nru remindor-common-13.08.2/remindor_common/threads.py remindor-common-14.01/remindor_common/threads.py
--- remindor-common-13.08.2/remindor_common/threads.py 2013-09-25 12:45:00.000000000 +0000
+++ remindor-common-14.01/remindor_common/threads.py 2013-10-22 11:37:04.000000000 +0000
@@ -91,29 +91,29 @@
logger.debug("Post request status: " + str(status))
class RunCommand(threading.Thread):
- def __init__(self, command, config_dir):
- threading.Thread.__init__(self)
- self.command = command
- self.outfile = os.path.join(config_dir, 'command_output.txt')
+ def __init__(self, command, config_dir):
+ threading.Thread.__init__(self)
+ self.command = command
+ self.outfile = os.path.join(config_dir, 'command_output.txt')
- def run(self):
- logger.debug('start command: %s' % (self.command))
- start = time.time()
+ def run(self):
+ logger.debug('start command: %s' % (self.command))
+ start = time.time()
- output = ''
- try:
- output = subprocess.check_output(self.command, stderr=subprocess.STDOUT, shell=True)
- logger.debug('command exited with a status of 0')
- except subprocess.CalledProcessError as e:
- logger.error('command exited with a status of %d' % (e.returncode))
- output = e.output
+ output = ''
+ try:
+ output = subprocess.check_output(self.command, stderr=subprocess.STDOUT, shell=True)
+ logger.debug('command exited with a status of 0')
+ except subprocess.CalledProcessError as e:
+ logger.error('command exited with a status of %d' % (e.returncode))
+ output = e.output
- try:
- f = open(self.outfile, 'w')
- f.write(output)
- f.close()
- except IOError:
- logger.error('could not write output to the file: %s' % (self.outfile))
- logger.debug('command output: %s' % (output))
+ try:
+ f = open(self.outfile, 'w')
+ f.write(output)
+ f.close()
+ except IOError:
+ logger.error('could not write output to the file: %s' % (self.outfile))
+ logger.debug('command output: %s' % (output))
- logger.debug('end command (%ss)' % (time.time() - start))
+ logger.debug('end command (%ss)' % (time.time() - start))
diff -Nru remindor-common-13.08.2/setup.py remindor-common-14.01/setup.py
--- remindor-common-13.08.2/setup.py 2013-10-14 01:01:52.000000000 +0000
+++ remindor-common-14.01/setup.py 2014-01-07 01:54:15.000000000 +0000
@@ -27,11 +27,11 @@
DistUtilsExtra.auto.setup(
name='remindor-common',
- version='13.08.2',
+ version='14.01',
license='GPL-3',
author='Brian Douglass',
author_email='bhdouglass@gmail.com',
description='Common files for indicator-remindor and remindor-qt.',
url='http://bhdouglass.tk/remindor/',
long_description='Common files for indicator-remindor and remindor-qt.'
-)
\ No newline at end of file
+)
diff -Nru remindor-common-13.08.2/tests/test_date_validation.py remindor-common-14.01/tests/test_date_validation.py
--- remindor-common-13.08.2/tests/test_date_validation.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/tests/test_date_validation.py 2013-10-22 11:35:23.000000000 +0000
@@ -0,0 +1,97 @@
+import remindor_common.datetimeutil as d
+
+valid_singular = [
+ "today",
+ "tomorrow",
+ "yesterday",
+ "Monday",
+ "mon",
+ "next MON",
+ "nx monday",
+ "next friday",
+ "October 28, 2012",
+ "oct 28",
+ "9/28/2012",
+ "9/28",
+ "9-28-2012",
+ "9-28",
+ "5",
+ "+5",
+ "-5",
+ "next 31",
+ "next 1",
+ "next 28"
+ ]
+
+valid_repeating = [
+ "every monday",
+ "every monday from 9/28/2012",
+ "every monday from 2 to 30",
+ "every day",
+ "every day from -5",
+ "every day from -5 to +5",
+ "every 30",
+ "every 30 from 9/28",
+ "every 30 from 1 to next 31",
+ "every 30 days",
+ "every 30 days from next 5",
+ "every 30 days from 2/28 to next monday",
+ "every weekday",
+ "every weekday from monday",
+ "every weekday from monday to next monday",
+ "every weekend",
+ "every weekend from sun",
+ "every weekend from Oct 8, 2012 to October 8, 2013",
+ "every other",
+ "every other from 5",
+ "every other from 5 to 10",
+ "next 30 days",
+ "next 30 days from yesterday",
+ "every 3 weeks",
+ "every 3 months",
+ "every 3 years",
+ "every days"
+ ]
+
+invalid = ["asdf", "532asdf", "every asdf", "nx asdf", "monday tomorrow", "tomorrow every",
+ "every 30 from asdf", "every 30 asdf", "every 30 days from asdf", "every 30 from", "m",
+ "every 33", "next monday from 8", "every monday to 8", "toda", "next weekday", "next day",
+ "next 30 monday", "asdf 12 2012", "every other day", "every other from", "weekday next",
+ "30 weekday", "next 30 monday", "every tomorrow", "every m", "next other",
+ "every day from 8 to 7", "", "next 30 days from 5 to 6", "every day from to", "next -1",
+ "8:30pm", "13:02", "years"]
+
+print "testing valid singular dates"
+for row in valid_singular:
+ print "?" + row + "?"
+ value = d.str_date_simplify(row, 0)
+ print "!" + str(value) + "!"
+
+ if value == None:
+ print "value should not be None!"
+ exit()
+
+print ""
+print "testing valid repeating dates"
+for row in valid_repeating:
+ print "?" + row + "?"
+ value = d.str_date_simplify(row, 0)
+ print "!" + str(value) + "!"
+
+ if value == None:
+ print "value should not be None!"
+ exit()
+
+print ""
+print "testing invalid dates"
+for row in invalid:
+ print row
+ value = d.str_date_simplify(row, 0)
+ print value
+
+ if value != None:
+ print "value should be None!"
+ exit()
+
+print ''
+print 'test successful'
diff -Nru remindor-common-13.08.2/tests/test_date_validation2.py remindor-common-14.01/tests/test_date_validation2.py
--- remindor-common-13.08.2/tests/test_date_validation2.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/tests/test_date_validation2.py 2013-12-06 01:20:23.000000000 +0000
@@ -0,0 +1,126 @@
+#!/usr/bin/python
+
+import os, sys
+sys.path.insert(0, os.getcwd())
+
+import remindor_common.datetimeutil2 as d
+
+valid_singular = [
+ 'today',
+ 'tomorrow',
+ 'yesterday',
+ 'Monday',
+ 'mon',
+ 'next MON',
+ 'nx monday',
+ 'next friday',
+ 'October 28, 2012',
+ 'oct 28',
+ '9/28/2012',
+ '9/28',
+ '9-28-2012',
+ '9-28',
+ '5',
+ '+5',
+ '-5',
+ 'next 31',
+ 'next 1',
+ 'next 28',
+ 'christmas',
+ 'next christmas',
+ 'christmas eve',
+ 'next christmas eve',
+ 'new years',
+ 'next new years',
+ 'new years eve',
+ 'next new years eve',
+ 'easter',
+ 'next easter',
+ 'groundhogs day',
+ 'next groundhogs day',
+ 'valentines day',
+ 'next valentines day',
+ 'halloween',
+ 'next halloween'
+ ]
+
+valid_repeating = [
+ 'every monday',
+ 'every monday from 9/28/2012',
+ 'every monday from 2 to 30',
+ 'every day',
+ 'every day from -5',
+ 'every day from -5 to +5',
+ 'every 30',
+ 'every 30 from 9/28',
+ 'every 30 from 1 to next 31',
+ 'every 30 days',
+ 'every 30 days from next 5',
+ 'every 30 days from 2/28 to next monday',
+ 'every weekday',
+ 'every weekday from monday',
+ 'every weekday from monday to next monday',
+ 'every weekend',
+ 'every weekend from sun',
+ 'every weekend from Oct 8, 2012 to October 8, 2013',
+ 'every other',
+ 'every other from 5',
+ 'every other from 5 to 10',
+ 'next 30 days',
+ 'next 30 days from yesterday',
+ 'every 3 weeks',
+ 'every 3 months',
+ 'every 3 years',
+ 'every days',
+ 'every mon,tues',
+ 'every tues, thursday'
+ ]
+
+invalid = ['asdf', '532asdf', 'every asdf', 'nx asdf', 'monday tomorrow', 'tomorrow every',
+ 'every 30 from asdf', 'every 30 asdf', 'every 30 days from asdf', 'every 30 from', 'm',
+ 'every 33', 'next monday from 8', 'every monday to 8', 'toda', 'next weekday', 'next day',
+ 'next 30 monday', 'asdf 12 2012', 'every other day', 'every other from', 'weekday next',
+ '30 weekday', 'next 30 monday', 'every tomorrow', 'every m', 'next other',
+ 'every day from 8 to 7', '', 'next 30 days from 5 to 6', 'every day from to', 'next -1',
+ '8:30pm', '13:02', 'years', 'every asdf,tues', 'every tues, asdf']
+
+format = d.BaseFormat()
+
+print 'testing valid singular dates'
+for row in valid_singular:
+ print '?' + row + '?'
+ date = d.Date(row, format)
+ date.parse()
+ print '!' + str(date.time) + '!'
+
+ if not date.valid:
+ print 'invalid!'
+ exit()
+
+print ''
+print 'testing valid repeating dates'
+for row in valid_repeating:
+ print '?' + row + '?'
+ date = d.Date(row, format)
+ date.parse()
+ print '!' + str(date.time) + '!'
+
+ if not date.valid:
+ print 'invalid!'
+ exit()
+
+print ''
+print 'testing invalid dates'
+for row in invalid:
+ print row
+ date = d.Date(row, format)
+ date.parse()
+ #print date.time
+
+ if date.valid:
+ print '!' + str(date.time) + '!'
+ print 'valid!'
+ exit()
+
+print ''
+print 'test successful'
diff -Nru remindor-common-13.08.2/tests/test_simple_parse.py remindor-common-14.01/tests/test_simple_parse.py
--- remindor-common-13.08.2/tests/test_simple_parse.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/tests/test_simple_parse.py 2013-06-21 12:47:08.000000000 +0000
@@ -0,0 +1,58 @@
+from remindor_common import datetimeutil as d
+
+valid = [
+ "exercise every 1 day at 6 am",
+ "exercise every 3 days at 6 pm",
+ "exercise every 3 weeks at 6 pm",
+ "exercise every 3 months at 6 pm",
+ "exercise every 3 years at 6 pm",
+ "board meeting on 8/7/13 at 2:30 am",
+ "board meeting on next monday at 2:30pm",
+ "travel home on 8/7/13",
+ "travel home on next monday",
+ "meet bob at 6:15am",
+ "meet bob at 6:15 pm",
+ "take pills every 4 hours",
+ "take pills every 1 minute",
+ "exercise every 3 days",
+ "exercise every 3 week",
+ "exercise every 3 years",
+ "go to the store in 20 minutes",
+ "go to the store in 2 hour",
+ "exercise ever 1 days at 6 pm", #actually valid because of the at
+ "at 6:15pm" #actually valid without a label
+ ]
+
+invalid = [
+ "exercise every x days at 6 pm",
+ #"exercise ever 1 days at 6 pm", #actually valid because of the at
+ "exercise every 3 days at 6x",
+ "exercise",
+ "exercise every at",
+ "exercise at",
+ "exercise every",
+ "board meeting on 2:30 pm",
+ "at 6:15pm meet bob",
+ #"at 6:15pm", #actually valid without a label
+ "go to the store in 20 days"
+ ]
+
+print "parsing valid"
+for row in valid:
+ print row
+ parsed = d.simple_parse(row)
+ print parsed
+
+ if parsed[0] == None or parsed[1] == None:
+ print "Should not be none!"
+ exit()
+
+print "\nparsing invalid"
+for row in invalid:
+ print row
+ parsed = d.simple_parse(row)
+ print parsed
+
+ if parsed[0] != None or parsed[1] != None:
+ print "Should be none!"
+ exit()
diff -Nru remindor-common-13.08.2/tests/test_str_to_day.py remindor-common-14.01/tests/test_str_to_day.py
--- remindor-common-13.08.2/tests/test_str_to_day.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/tests/test_str_to_day.py 2013-10-22 11:36:45.000000000 +0000
@@ -0,0 +1,128 @@
+from datetime import datetime, timedelta
+from dateutil import parser
+import remindor_common.datetimeutil as d
+
+singular = [
+ "today",
+ "tomorrow",
+ "yesterday",
+ "Monday",
+ "mon",
+ "next MON",
+ "nx monday",
+ "October 28, 2012",
+ "oct 28",
+ "9/28/2012",
+ "9/28",
+ "9-28-2012",
+ "9-28",
+ "5",
+ "+5",
+ "-5",
+ "next 31",
+ "next 1",
+ "next 28"
+ ]
+
+today = datetime.today()
+today = today.replace(hour=0, minute=0, second=0, microsecond=0)
+valid_singular = [
+ today,
+ today + timedelta(days=1),
+ today - timedelta(days=1),
+ parser.parse("monday"),
+ parser.parse("monday"),
+ parser.parse("monday") + timedelta(days=7),
+ parser.parse("monday") + timedelta(days=7),
+ datetime(2012, 10, 28),
+ datetime(2012, 10, 28),
+ datetime(2012, 9, 28),
+ datetime(2012, 9, 28),
+ datetime(2012, 9, 28),
+ datetime(2012, 9, 28),
+ today + timedelta(days=5),
+ today + timedelta(days=5),
+ today - timedelta(days=5),
+ datetime(2012, 10, 31), #set this manually
+ datetime(2012, 10, 1), #set this manually
+ datetime(2012, 10, 28) #set this manually
+ ]
+
+repeating = [
+ "every monday",
+ "every monday from 9/28/2012",
+ "every monday from 2 to 30",
+ "every day",
+ "every day from -5",
+ "every day from -5 to +5",
+ "every 30",
+ "every 30 from 9/28",
+ "every 30 from next 1 to next 31",
+ "every 30 days",
+ "every 30 days from next 5",
+ "every 30 days from 9/28 to next monday",
+ "every weekday",
+ "every weekday from monday",
+ "every weekday from monday to next monday",
+ "every weekend",
+ "every weekend from sun",
+ "every weekend from Oct 8, 2012 to October 8, 2013",
+ "every other",
+ "every other from 5",
+ "every other from 5 to 10",
+ "next 30 days",
+ "next 30 days from yesterday",
+ ]
+
+#set these manually
+valid_repeating = [
+ "every monday",
+ "every monday from 9/28/2012",
+ "every monday from 2 to 30",
+ "every day",
+ "every day from -5",
+ "every day from -5 to +5",
+ "every 30",
+ "every 30 from 9/28",
+ "every 30 from next 1 to next 31",
+ "every 30 days",
+ "every 30 days from next 5",
+ "every 30 days from 9/28 to next monday",
+ "every weekday",
+ "every weekday from monday",
+ "every weekday from monday to next monday",
+ "every weekend",
+ "every weekend from sun",
+ "every weekend from Oct 8, 2012 to October 8, 2013",
+ "every other",
+ "every other from 5",
+ "every other from 5 to 10",
+ "next 30 days",
+ "next 30 days from yesterday",
+ ]
+
+counter = 0
+for row in singular:
+ value = d.str_date_simplify(row, 0)
+ print str(value) + " (" + row + ")"
+ dt = d.str_to_date(None, value)
+ print dt
+
+ if dt != valid_singular[counter]:
+ print "should be " + str(valid_singular[counter])
+ exit()
+
+ counter += 1
+
+counter = 0
+for row in repeating:
+ value = d.str_date_simplify(row, 0)
+ print str(value) + " (" + row + ")"
+ dt = d.str_to_date(None, value)
+ print dt
+
+ '''if dt != valid_singular[counter]:
+ print "should be " + str(valid_singular[counter])
+ exit()'''
+
+ counter += 1
diff -Nru remindor-common-13.08.2/tests/test_time_validation.py remindor-common-14.01/tests/test_time_validation.py
--- remindor-common-13.08.2/tests/test_time_validation.py 1970-01-01 00:00:00.000000000 +0000
+++ remindor-common-14.01/tests/test_time_validation.py 2013-10-22 11:36:51.000000000 +0000
@@ -0,0 +1,69 @@
+import remindor_common.datetimeutil as d
+
+valid_singular = [
+ "now",
+ "1:00pm",
+ "1:00 pm",
+ "13:00",
+ "13",
+ "1300",
+ "1pm"
+ ]
+
+valid_repeating = [
+ "every hour",
+ "every hour from 1 to 1:00pm",
+ "every minute",
+ "every minute from 2:00pm to 1500",
+ "every 3 minutes",
+ "every 3 minutes from 3:30pm to 3:45 pm",
+ "every 2 hours",
+ "every 2 hours from 8 to 10"
+ ]
+
+invalid = [
+ "every minute from",
+ "asdf",
+ "every minutes to 3",
+ "2500",
+ "25",
+ "-1",
+ "every -2 minutes",
+ "every minute from 5 to 1",
+ "every minute from 5 to 5",
+ "8/12/13",
+ "October 12",
+ "7-21-2013"
+ ]
+
+print "testing valid singular times"
+for row in valid_singular:
+ print "?" + row + "?"
+ value = d.str_time_simplify(row)
+ print "!" + str(value) + "!"
+
+ if value == None:
+ print "value should not be None!"
+ exit()
+
+print ""
+print "testing valid repeating times"
+for row in valid_repeating:
+ print "?" + row + "?"
+ value = d.str_time_simplify(row)
+ print "!" + str(value) + "!"
+
+ if value == None:
+ print "value should not be None!"
+ exit()
+
+print ""
+print "testing invalid times"
+for row in invalid:
+ print row
+ value = d.str_time_simplify(row)
+ print value
+
+ if value != None:
+ print "value should be None!"
+ exit()