diff -Nru wakeup-1.1/data/com.ubuntu.wakeup.policy wakeup-1.2/data/com.ubuntu.wakeup.policy --- wakeup-1.1/data/com.ubuntu.wakeup.policy 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/com.ubuntu.wakeup.policy 2012-02-06 23:45:33.000000000 -0800 @@ -0,0 +1,20 @@ + + + + Wakeup + https://launchpad.net/wakeup + + + Authentication is required to modify Wakeup boot alarms + Change boot alarms + appointment-new + + no + no + auth_admin_keep + + /usr/share/wakeup/wakeupRootHelper + + diff -Nru wakeup-1.1/data/scripts/setalarm wakeup-1.2/data/scripts/setalarm --- wakeup-1.1/data/scripts/setalarm 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/scripts/setalarm 2012-01-15 00:17:25.000000000 -0800 @@ -3,7 +3,7 @@ # future or recurrently for some general cron-formatted times. The computer is # actually woken up 5 minutes earlier than specified, and a given script is set # to run at the exact time given via crontab. This script must be run as root. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 # For only print next wakeup time @@ -20,15 +20,10 @@ # Clear the system wakeup alarm. echo 0 > /sys/class/rtc/rtc0/wakealarm; - # Make copy of crontab, delete old alarms - tmpfile=/tmp/setalarm_tmp.txt - crontab -l > $tmpfile - sed -i /^.*setalarm.*$/d $tmpfile # For delete alarms if [[ $1 == "-d" ]]; then - crontab $tmpfile - rm $tmpfile + (crontab -l | sed /^.*setalarm.*$/d) | crontab - exit 0 fi fi @@ -113,8 +108,10 @@ exit fi crontab_time=`date -d @$wake_time "+%M %H %d %m %w"` - # add to temporary cron file - echo "$crontab_time DISPLAY=:0 $wakeup_script >/dev/null 2>&1 #entered by setalarm" >> $tmpfile + newline="$crontab_time $wakeup_script >/dev/null 2>&1 #entered by setalarm" + if [[ $wakeup_script != "" ]]; then + (crontab -l | sed /^.*setalarm.*$/d; echo $newline) | crontab - + fi # for recurrent alarms elif [[ $1 == "-c" ]]; then @@ -159,7 +156,6 @@ done 2>/dev/null if [[ $date == "" || $wake_time < `date +%s` || `chkw` != 1 ]]; then - if [[ ! $only_print ]]; then rm $tmpfile; fi echo "The specified cron time does not occur within a year" exit 1 fi @@ -183,10 +179,12 @@ fi # add cron for setlarm that runs wtih the $wakeup_script and @reboot - echo "$2 $3 $4 $5 $6 DISPLAY=:0 $0 ${*/\*/\"*\"} >/dev/null 2>&1" >> $tmpfile - echo "@reboot DISPLAY=:0 $0 ${*/\*/\"*\"} >/dev/null 2>&1" >> $tmpfile - # add the cron-recurrent wakeup alarm to temporary cron file - echo "$2 $3 $4 $5 $6 DISPLAY=:0 $wakeup_script >/dev/null 2>&1 #entered by setalarm" >> $tmpfile + newline1="$2 $3 $4 $5 $6 $0 ${*/\*/\"*\"} >/dev/null 2>&1\n" + newline2="@reboot $0 ${*/\*/\"*\"} >/dev/null 2>&1" + if [[ $wakeup_script != "" ]]; then + newline3="\n$2 $3 $4 $5 $6 $wakeup_script >/dev/null 2>&1 #entered by setalarm" + fi + (crontab -l | sed /^.*setalarm.*$/d; echo -e "$newline1$newline2$newline3") | crontab - # for non-recurring alarms else @@ -201,18 +199,14 @@ fi # format $wakeup_time in crontab format. crontab_time=`date -d @$wake_time "+%M %H %d %m %w"` - # add to temporary cron file - echo "$crontab_time DISPLAY=:0 $wakeup_script >/dev/null 2>&1 #entered by setalarm" >> $tmpfile + if [[ $wakeup_script != "" ]]; then + newline="$crontab_time $wakeup_script >/dev/null 2>&1 #entered by setalarm" + (crontab -l | sed /^.*setalarm.*$/d; echo $newline) | crontab - + fi fi -# Actually set alarm and crontab # - +# Actually set alarm # echo $(( $wake_time - $offset * 60 )) > /sys/class/rtc/rtc0/wakealarm; echo -e "Alarm set to: $(date -d @$wake_time)" +# Remind user about offset if [[ $offset_set ]]; then echo "Computer will wake $offset minutes earlier"; fi -# Write the actual crontab file and clean up. -if [[ $wakeup_script == "" ]]; then - sed -i '/.*#entered by setalarm/d' $tmpfile -fi -crontab $tmpfile -rm $tmpfile diff -Nru wakeup-1.1/data/scripts/wakeup wakeup-1.2/data/scripts/wakeup --- wakeup-1.1/data/scripts/wakeup 2011-09-23 12:29:53.000000000 -0700 +++ wakeup-1.2/data/scripts/wakeup 2012-01-14 20:42:36.000000000 -0800 @@ -1,6 +1,6 @@ #!/bin/bash # Runs a given alarm set by wakeup-settings for a given user. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 # initialize environment variables @@ -19,9 +19,11 @@ # set volume # see http://ubuntuforums.org/showthread.php?t=1796713 -volume=$(grep -A 2 "volume" $home/.wakeup/alarm$2/wakeup_settings | grep "F" | sed 's/F//') -/usr/bin/amixer set Master $volume% unmute -/usr/bin/amixer set Master $volume% unmute +volume=$(grep -A 2 "volume" $home/.wakeup/alarm$2/wakeup_settings | awk "NR==3" | grep -oP "[0-9\.]+") +if [[ $volume == "" ]]; then + volume=50 +fi +/usr/bin/amixer set Master playback $volume% unmute /usr/bin/amixer set Headphone unmute /usr/bin/amixer set Speaker unmute /usr/bin/amixer set PCM 100% unmute @@ -42,9 +44,13 @@ exit 0 } + +trap "stop; exit" SIGHUP SIGINT SIGTERM + # allow the user to end it all while [ ! ]; do - if [[ "$(who | grep -o -m 1 $usr)" == $usr ]]; then + eval export $(grep --text -oP "DISPLAY=:[0-9\.]*" /proc/$(pgrep -n gnome-session)/environ) + if [[ $DISPLAY != "" ]]; then sleep 2 eval "snooze=$($dosudo /usr/share/wakeup/stopalarm.py)" if [[ $snooze == 0 ]]; then @@ -58,12 +64,9 @@ /usr/bin/setalarm -u $(date -d "+$snooze min" "+%s") $offset dosudo="sudo" fi - tmpfile=/tmp/wake - eval "$dosudo crontab -l >$tmpfile" snoozetime=$(date -d "+$snooze min" "+%M %H %d %m %w") - echo "$snoozetime DISPLAY=:0 /usr/bin/wakeup $1 $2 >/dev/null 2>&1"\ - "#entered by setnextalarm" >>$tmpfile - eval "$dosudo crontab $tmpfile; rm $tmpfile" + newcronline="$snoozetime /usr/bin/wakeup $1 $2 >/dev/null 2>&1 #entered by setnextalarm" + (eval $dosudo crontab -l; echo $newcronline) | eval $dosudo crontab - stop fi else continue @@ -74,7 +77,7 @@ # play the alarm export DBUS_SESSION_BUS_ADDRESS PATH filename="$home/.wakeup/alarm$2/playable_text" -if [[ $2 == "test" ]]; then filename="$home/.wakeup/playable_tmp"; fi +if [[ $3 == "test" ]]; then filename="$home/.wakeup/playable_tmp"; fi chmod +x $filename echo "About to play the text..." $filename $usr diff -Nru wakeup-1.1/data/scripts/wakeup-settings wakeup-1.2/data/scripts/wakeup-settings --- wakeup-1.1/data/scripts/wakeup-settings 2011-05-23 12:27:21.000000000 -0700 +++ wakeup-1.2/data/scripts/wakeup-settings 2012-02-07 10:39:03.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Runs the GUI for user to set alarms and their preferences. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk @@ -11,11 +11,11 @@ import os import re import sys -from commands import getstatusoutput, getoutput import copy import pickle import threading import subprocess +import dbus # Global file variables wakeup_script = "/usr/bin/wakeup" @@ -30,6 +30,7 @@ dontshowintrofile = os.path.join(homewakeupfolder, "dontshowintro") tmpPlayfile = os.path.join(homewakeupfolder, "playable_tmp") voicelistscript = os.path.join(wakeup_folder, "voice_list.sh") +elevatescript = os.path.join(wakeup_folder, 'wakeupRootHelper') # import alarm data type sys.path.append(wakeup_folder) @@ -206,7 +207,7 @@ defaultpluginfolder = os.path.join(defaultpluginsfolder, folder) pluginfolder = os.path.join(pluginsfolder, folder) if os.path.isdir(defaultpluginfolder) and not os.path.exists(pluginfolder): - os.system("cp -R " + defaultpluginfolder + " " + pluginfolder) + subprocess.call(["cp", "-R", defaultpluginfolder, pluginfolder]) '''Setup the GUI alarm list''' myiter = self.alarmlist.get_iter_first() self.change_alarmlist_item(self.alarms[-1], myiter) @@ -229,7 +230,10 @@ self.window = mainSelf threading.Thread.__init__(self) def run(self): - output = subprocess.check_output(voicelistscript) + try: + output = subprocess.check_output(voicelistscript) + except subprocess.CalledProcessError as e: + output = e.output voicesanddescripts = re.split("\n", output) for i in range(0, len(voicesanddescripts)-1): if i % 2 == 1: continue @@ -272,18 +276,38 @@ def cancel_clicked (self, widget, data=None): for i in range(0, len(self.alarmsjustcreated)): if self.alarmsjustcreated[i]: - os.system("rm -R " + self.alarmfolders[i]) + subprocess.call(["rm", "-R", self.alarmfolders[i]]) self.on_window_destroy(self, widget) '''Callback for clicking Apply in main window''' def apply_clicked (self, widget, data=None): + # Get elevated privileges if needed; every call to sudo in alarm.py and setnextalarm.py + # will then be carried out. + for alarm in self.oldalarms + self.alarms: + if alarm.get_property("wakecomputer"): + try: + action_id='com.ubuntu.wakeup.exec' + bus = dbus.SystemBus() + service = bus.get_object('org.freedesktop.PolicyKit1', '/org/freedesktop/PolicyKit1/Authority') + policy_kit=dbus.Interface(service, 'org.freedesktop.PolicyKit1.Authority') + system_bus_name = bus.get_unique_name() + result = policy_kit.CheckAuthorization(('system-bus-name', {'name' : system_bus_name}), action_id, {}, 1, '') + if not result[0]: + raise BaseException + except BaseException as e: + print e.args + outscript = 'Unable to set alarms. Root privileges needed if using boot option.' + self.dialogMessage.set_text(outscript.strip()) + self.dialogWindow.show() + return + break for i in range(0, len(self.alarmsjustcreated)): self.alarmsjustcreated[i] = False self.on_alarm_selected(None) # make sure current text is saved for i in range(0, len(self.alarms)): if not os.path.exists(self.alarmfolders[i]): os.mkdir(self.alarmfolders[i]) - os.system("cp -R " + defaultpluginsfolder + " " + os.path.join(self.alarmfolders[i], "plugins")) + subprocess.call(["cp", "-R", defaultpluginsfolder, os.path.join(self.alarmfolders[i], "plugins")]) folder = re.search("alarm\d+", self.alarmfolders[i]).group(0) self.alarms[i].save_playfile(os.path.join(self.alarmfolders[i], "playable_text"), folder, False, self.plugins) @@ -291,7 +315,7 @@ # delete removed alarms for folder in self.oldalarmfolders: if not folder in self.alarmfolders: - os.system("rm -r " + folder) + subprocess.call(["rm", "-rf", folder]) hadbootalarms = False for alarm in self.oldalarms: if alarm.get_property("wakecomputer") == True: @@ -299,8 +323,7 @@ else: alarmfolder = self.oldalarmfolders[self.oldalarms.index(alarm)] foldernumber = re.search("\d+", alarmfolder).group(0) - command = alarm.get_remove_command(self.oldalarmfolders[self.oldalarms.index(alarm)], wakeup_script) - os.system(command) + alarm.remove_command(self.oldalarmfolders[self.oldalarms.index(alarm)], wakeup_script) # Set the alarms and remove removed boot alarms hasbootalarms = False success = True @@ -308,22 +331,19 @@ for alarm in self.alarms: if not alarm.get_property("wakecomputer"): folder = self.alarmfolders[self.alarms.index(alarm)] - command = alarm.get_setalarm_command(folder, setalarm_script, wakeup_script) - [status, output] = getstatusoutput(command) - if output != "": - success = False + [success, out] = alarm.setalarm_command(folder, setalarm_script, wakeup_script) + success = (success == 0) else: hasbootalarms = True if hasbootalarms or hadbootalarms: #note also removes removed boot alarms. - [status, output] = getstatusoutput('gksudo --message ' + \ - '"Root privaleges are necessary to set and remove alarms that wake your computer" ' + \ - setnextalarmscript + " $USER") - if status != 0: - success = False - outscript += output - else: + output = "" + try: + output = subprocess.check_output(['pkexec', elevatescript, setnextalarmscript, os.environ['USER']]) if not len(self.alarms) == 0 and not output == "": outscript += "Next computer wakeup at: " + output + except subprocess.CalledProcessError as e: + success = False + outscript += e.output if success == False: outscript = "Unable to set all alarms. Check time preferences.\n" + outscript else: @@ -345,7 +365,7 @@ alarm = self.alarms[self.currentalarm] folder = re.search("alarm\d+", self.alarmfolders[self.currentalarm]).group(0) alarm.save_playfile(tmpPlayfile, folder, True, self.plugins) - os.system(wakeup_script + " $USER test &") + subprocess.call([wakeup_script, os.environ['USER'], re.search("\d+",folder).group(0), "test", "&"]) '''Callback for clicking Help in main window''' def help_clicked (self, widget, data=None): if widget.get_label() == "gtk-about": @@ -410,7 +430,7 @@ def on_plugins_cancel_clicked (self, widget, data=None): # Restore the backup of previously active plugins and remake plugin list self.plugin_window.hide() - return True + return False '''Callback for clicking Ok in plugins window''' def on_plugins_ok_clicked (self, widget, data=None): @@ -454,6 +474,16 @@ activeplugins.append(name) item = self.treemodel2.iter_next(item) alarm.set_property("activeplugins", activeplugins) + if "Commands" in activeplugins: + alarmfolder = self.alarmfolders[self.currentalarm] + command_pref_file = os.path.join(alarmfolder, 'plugins/Commands/Commands.config') + c_pref_file = open(command_pref_file, "r") + self.lines = ''.join(c_pref_file.readlines()) + c_pref_file.close() + old_items = re.search("dataitems=(.*)", self.lines).group(1).split(",") + if old_items == ['']: + old_items = [] + alarm.set_property("Commands_dataitems", old_items) myiter = self.alarmlist.get_iter_from_string(str(self.currentalarm)) self.change_alarmlist_item(alarm, myiter) self.on_alarm_selected(None) @@ -483,12 +513,14 @@ pluginfolder = os.path.join(self.alarmfolders[self.currentalarm], "plugins", plugin) exec("pluginPref = " + plugin + "." + plugin + "('" + pluginfolder + "')") pluginPref.window.set_modal(True) - pluginPref.window.set_transient_for(self.plugin_window) + # This next line actually makes it impossible to close plugin preferences more than once + #pluginPref.window.set_transient_for(self.plugin_window) # TODO: This doesn't seem to work at the moment, so all plugin # glade files have the hint set to dialog individually. # pluginPref.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) pluginPref.main() self.prefsOpen = False + return False '''Callback for toggling availability of a plugin by checking a box''' def on_plugin_toggled (self, widget, data=None): @@ -633,7 +665,7 @@ self.alarmsjustcreated.append(not os.path.exists(self.alarmfolders[-1])) if self.alarmsjustcreated[-1]: os.mkdir(self.alarmfolders[-1]) - os.system("cp -R " + defaultpluginsfolder + " " + os.path.join(self.alarmfolders[-1], "plugins")) + subprocess.call(["cp", "-R", defaultpluginsfolder, os.path.join(self.alarmfolders[-1], "plugins")]) '''Update alarm list entry''' def change_alarmlist_item(self, alarm, treeiter): text = re.sub("\s+", " ", alarm.get_property("text")) @@ -668,7 +700,7 @@ def remove_alarm(self, widget, data=None): pos = int(self.currentalarm) if self.alarmsjustcreated[pos]: - os.system("rm -R " + self.alarmfolders[pos]) + subprocess.call(["rm", "-R", self.alarmfolders[pos]]) del self.alarmsjustcreated[pos] position_selected = self.alarmlist.get_iter_from_string(str(pos)) if pos != 0: @@ -691,6 +723,7 @@ del self.alarmlist[pos] del self.alarms[pos] del self.alarmfolders[pos] + '''Callback for selecting an alarm from the list''' def on_alarm_selected(self, widget, data=None): model, paths = self.alarm_selection.get_selected_rows() @@ -718,6 +751,10 @@ if pluginname in alarm.get_property("activeplugins"): for item in self.plugins[pluginname]['data_items']: self.add_data_item("$" + item) + # Add in dynamic dataitems from Command plugin + if "Commands" in alarm.get_property("activeplugins"): + for item in alarm.get_property("Commands_dataitems"): + self.add_data_item("$" + item) def on_introdialog_destroy(self, widget, data=None): self.introdialog.hide() diff -Nru wakeup-1.1/data/wakeup/alarm.py wakeup-1.2/data/wakeup/alarm.py --- wakeup-1.1/data/wakeup/alarm.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/alarm.py 2012-02-07 10:23:27.000000000 -0800 @@ -1,10 +1,11 @@ #!/usr/bin/env python # alarm data type class used by wakeup-settings and setnextalarm. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 -import datetime, re, os, pickle +import datetime, re, os, pickle, subprocess days_dict = dict(Sun=0, Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6) +elevatescript = '/usr/share/wakeup/wakeupRootHelper' class alarm: @@ -25,6 +26,7 @@ self.otherspeechtool = "none" self.wakecomputer = True self.activeplugins = list() + self.Commands_dataitems = list() # for dynamic dataitems from Commands plugin def set_property(self, property_name, value): exec("self." + property_name + " = value") @@ -40,6 +42,12 @@ data_items.extend(plugins[key]['data_items']) for item in plugins[key]['data_items']: itemsToPlugin[item] = key + # Add in dynamic dataitems from Commands plugin + if "Commands" in self.activeplugins: + data_items.extend(self.Commands_dataitems) + for item in self.Commands_dataitems: + itemsToPlugin[item] = "Commands" + usedDataByPlugin = dict() for name in self.activeplugins: usedDataByPlugin[name] = list() @@ -63,6 +71,9 @@ for j in data_used: if j in data_items and itemsToPlugin[j] in self.activeplugins: usedDataByPlugin[itemsToPlugin[j]].append(j) + else: + i = re.sub('\$'+j,'\\\$'+j,i) + del data_used[data_used.index(j)] for name in usedDataByPlugin.keys(): if plugins[name]['text_output'] and not len(usedDataByPlugin[name]) == 0: itemsstring = "".join([k + " " for k in usedDataByPlugin[name]]) @@ -80,21 +91,31 @@ final_text += "\n" + init_string if has_text_output or len(data_used) == 0:\ final_text += "echo -e \"" + i + "\" | talk\n" - file = open(filename, "w") - file.write("#!/bin/bash\nusr=$1\n") - file.write("export ALARM=" + folder + "\nIFS=$'\\n\\n'\nshopt -s expand_aliases\n") + + top_text = "#!/bin/bash\nusr=$1\n" \ + + "export ALARM=" + folder + "\nIFS=$'\\n\\n'\nshopt -s expand_aliases\n" if not self.otherspeechtool == "none": - file.write("alias talk='" + self.otherspeechtool + "'\n\n") + top_text = top_text + "alias talk='" + self.otherspeechtool + "'\n\n" else: - file.write("alias talk='festival_client --ttw | aplay'\n") - file.write("festival --server ") + top_text = top_text + "alias talk='festival_client --ttw | aplay'\n" \ + + "festival --server " if self.voice != "none": - file.write("'(voice_" + self.voice + ")'") - file.write("&\nwhile [[ $(echo '()' | festival_client && echo $?) != 0 ]];" \ - + " do echo -n ''; done\n\n") - file.write(final_text) - file.close() - os.system("chmod +x " + filename) + top_text = top_text + "'(voice_" + self.voice + ")'" + top_text = top_text + "&\nwhile [[ $(echo '()' | festival_client && echo $?) != 0 ]];" \ + + " do echo -n ''; done\n\n" + final_text = top_text + final_text + + if self.wakecomputer and not isTmpFile: + createfilescript = '/usr/share/wakeup/createRootPlayfile.py' + fileout = subprocess.Popen(['pkexec', elevatescript, createfilescript, filename], stdin=subprocess.PIPE) + fileout.communicate(final_text) + else: + if os.path.exists(filename): + subprocess.call(['rm', '-f', filename]) # necessary because may be owned by root + file = open(filename, "w") + file.write(final_text) + file.close() + subprocess.call(["chmod", "+x", filename]) def save_settings(self, filename): cronval = "" @@ -126,49 +147,49 @@ except: return "wakeup_settings file not found or improperly formatted" return "Loaded wakeup settings" - def get_setalarm_command(self, folder, setalarm_script, wakeup_script): + def setalarm_command(self, folder, setalarm_script, wakeup_script): [minute, hour, dom, mon, dow] = self.get_cronvalues() - # workaround for minute spinbutton having only 1 digit for minutes < 10 - if minute < 10: - minute = "0" + str(minute) alarmnum = re.search("alarm(\d+)$", folder).group(1) wakeup_script_meta = re.sub("/", "\\/", wakeup_script) if self.wakecomputer: if self.recurrs == False: + # workaround for minute spinbutton having only 1 digit for minutes < 10 + if minute < 10: + minute = "0" + str(minute) command = setalarm_script + " " + str(hour) + ":" \ - + str(minute) + " " + wakeup_script + " $USER" + + str(minute) + " " + wakeup_script + " " + os.environ['USER'] + " " + alarmnum else: - command = setalarm_script + ' -c "' + str(minute) + '" "' \ - + str(hour) + '" "' + str(dom) + '" "' + str(mon) \ - + '" "' + str(dow) + '" ' + wakeup_script + " $USER" - command = 'gksudo --message \"root privaleges are necessary to '\ - + 'set the alarm\" \"' + command + "\"" + # Note, because shell=False in check_output, do not need to quote asterisks + command = setalarm_script + ' -c ' + str(minute) + ' ' \ + + str(hour) + ' ' + str(dom) + ' ' + str(mon) \ + + ' ' + str(dow) + ' ' + wakeup_script + " " + os.environ['USER'] + " " + alarmnum + command = ['pkexec', elevatescript] + re.split(" ", command) + try: + out = subprocess.check_output(command) + return [0, out] + except subprocess.CalledProcessError: + return [1, ""] else: - command = "tmpfile=/tmp/wakeup_tmp.txt\n" \ - + "crontab -l > $tmpfile\n" \ - + "sed -i \"/^.*" + wakeup_script_meta + " $USER " \ - + alarmnum + ".*$/d\" $tmpfile\n" \ - + "echo \"" + str(minute) + " " + str(hour) + " " \ - + str(dom) + " " + str(mon) + " " + str(dow) + " " \ - + "DISPLAY=:0 " + wakeup_script + " $USER " \ - + alarmnum + " >/dev/null 2>&1\" >> $tmpfile\n" \ - + "crontab $tmpfile\n" \ - + "rm $tmpfile" - return command + curcron = subprocess.check_output(['crontab', '-l']) + curcron = re.sub("[^\n]*" + wakeup_script_meta + " " + os.environ['USER'] + " " \ + + alarmnum + ".*\n", "", curcron) + updatecron = subprocess.Popen(['crontab', '-'], stdin = subprocess.PIPE) + newline = str(minute) + " " + str(hour) + " " + str(dom) + " " + str(mon) + " " + str(dow) + \ + " " + wakeup_script + " " + os.environ['USER'] + " " + alarmnum + " >/dev/null 2>&1\n" + updatecron.communicate(curcron + newline) + return [0,""] - def get_remove_command(self, folder, wakeup_script): + def remove_command(self, folder, wakeup_script): alarmnum = re.search("alarm(\d+)$", folder).group(1) wakeup_script_meta = re.sub("/", "\\/", wakeup_script) - sudo = "" + sudo = [] if self.wakecomputer: - sudo = "sudo" - command = "tmpfile=/tmp/wakeup_tmp.txt\n" \ - + sudo + " crontab -l > $tmpfile\n" \ - + "sed -i \"/^.*" + wakeup_script_meta + " $USER " \ - + alarmnum + ".*$/d\" $tmpfile\n" \ - + sudo + " crontab $tmpfile\n" \ - + "rm $tmpfile" - return command + sudo = ['pkexec', elevatescript] + curcron = subprocess.check_output(sudo + ['crontab', '-l']) + curcron = re.sub("[^\n]*" + wakeup_script_meta + " " + os.environ['USER'] + " " \ + + alarmnum + ".*\n", "", curcron) + updatecron = subprocess.Popen(sudo + ['crontab', '-'], stdin = subprocess.PIPE) + updatecron.communicate(curcron) def get_cronvalues(self): if self.recurrence == "Cron": diff -Nru wakeup-1.1/data/wakeup/createRootPlayfile.py wakeup-1.2/data/wakeup/createRootPlayfile.py --- wakeup-1.1/data/wakeup/createRootPlayfile.py 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/createRootPlayfile.py 2012-01-22 10:36:13.000000000 -0800 @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# A separate file is needed to create the boot alarms playfile with root permissions pre-writing. +# This script provides that file. Should be run as root. +# Copyright (C) 2012 David Glass +# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 + +import sys, os, stat +text = ''.join(sys.stdin.readlines()) +filename = sys.argv[1] + + +# opens as 644 (group and others can only read, owner can't execute) +f = open(filename, 'w') +f.write(text) +f.close() + +# changes permissions to 700 (add execute to owner, remove read from all others) +os.chmod(filename, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR) diff -Nru wakeup-1.1/data/wakeup/default_plugin_confs/Commands/Commands.config wakeup-1.2/data/wakeup/default_plugin_confs/Commands/Commands.config --- wakeup-1.1/data/wakeup/default_plugin_confs/Commands/Commands.config 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/default_plugin_confs/Commands/Commands.config 2011-12-26 20:08:14.000000000 -0800 @@ -0,0 +1,2 @@ +dataitems= +scripts= diff -Nru wakeup-1.1/data/wakeup/location.py wakeup-1.2/data/wakeup/location.py --- wakeup-1.1/data/wakeup/location.py 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/location.py 2012-02-07 10:59:32.000000000 -0800 @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# get location for Weather +# Copyright (C) 2012 David Glass +# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 + +# Note this function can be imported, and gives a dictionary output of location data +# as available from the source www.ip-address.org. Data available may depend on location, +# but should include: 'City', 'State', 'Country', 'Continent', 'Time zone', 'City Lat/Lon', +# 'Country Lat/Lon', 'Continent Lat/Lon', 'My IP Address', 'My IP Host', 'ISP', 'Postal', +# and others. +# Some data about the computer, such as Browser, is useless but left for completion. +# Additionally, the dict keys 'longitude' and 'latitude' are added for ease of use; they +# are just taken from key 'City Lat/Lon'. + +import urllib2 +import re + +def get_location(): + # Grab information about location based on IP + url = 'http://www.ip-address.org' + req = urllib2.Request(url) + response = urllib2.urlopen(req,'',5) + page = response.read() + tables = re.findall("", page,flags=re.DOTALL) # find tables + table = tables[1] # get the right table + table = re.sub(r"([^<]*)\1 tags + table = re.sub("
", ";", table) + tableelements = re.findall(".*?", table, flags=re.DOTALL) + properties = {} + for el in tableelements: + try: # Get rid of leading junk, which may contain a tag + el = re.search('.*', el, re.DOTALL).group(0) + except: + continue + prop = re.search("(.*):\s*", el, flags=re.DOTALL) + val = re.search("(.*)", el, flags=re.DOTALL) + if val: # skip if no value for this property (ie, it is just a header) + properties[prop.group(1).strip()] = re.sub("<.*>| ", "", val.group(1).strip()) + # Add latitude and longitude keys for direct ease of use + [properties['latitude'],properties['longitude']] = \ + re.findall("[0-9\.\-]+", properties['City Lat/Lon']) + return properties diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Commands/Commands.glade wakeup-1.2/data/wakeup/plugin_scripts/Commands/Commands.glade --- wakeup-1.1/data/wakeup/plugin_scripts/Commands/Commands.glade 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/plugin_scripts/Commands/Commands.glade 2011-12-26 20:08:14.000000000 -0800 @@ -0,0 +1,253 @@ + + + + + + + + + + + + + True + False + 6 + User Commands + center + dialog + False + + + + 400 + 200 + True + False + + + True + False + 2 + 3 + 2 + 3 + + + True + True + + True + + + + 1 + 2 + + + + + True + True + + True + + + + 1 + 3 + 1 + 2 + + + + + True + False + 1 + Data item: $ + + + + + True + False + 1 + Command: + + + 1 + 2 + + + + + 42 + True + False + + + 2 + 3 + + + + + False + True + 0 + + + + + True + False + + + True + True + in + + + True + True + liststore1 + False + 0 + + + + + + + + Data item + True + + + + 0 + + + + + + + Command + True + + + + 1 + + + + + + + + + True + True + 0 + + + + + True + False + vertical + icons + False + + + True + False + False + True + gtk-add + + + + False + True + + + + + True + False + False + True + gtk-remove + + + + False + True + + + + + False + False + end + 1 + + + + + True + True + 1 + + + + + True + False + 3 + + + gtk-ok + True + True + True + False + True + + + + True + True + 0 + + + + + gtk-cancel + True + True + True + False + True + + + + True + True + 1 + + + + + False + True + 2 + 2 + + + + + + diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Commands/Commands.py wakeup-1.2/data/wakeup/plugin_scripts/Commands/Commands.py --- wakeup-1.1/data/wakeup/plugin_scripts/Commands/Commands.py 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/plugin_scripts/Commands/Commands.py 2012-01-03 12:29:36.000000000 -0800 @@ -0,0 +1,137 @@ +#!/usr/bin/env python +# plugin GUI preferences class for Commands +# Copyright (C) 2012 David Glass +# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 + +import pygtk +pygtk.require('2.0') +import gtk +import gtk.glade +import os +import re + + +class Commands: + + def __init__(self, pluginfolder): + self.wTree = gtk.Builder() + self.wTree.add_from_file("Commands.glade") + self.wTree.connect_signals(self) + self.window = self.wTree.get_object("window1") + self.item_entry = self.wTree.get_object("entry1") + self.command_entry = self.wTree.get_object("entry2") + self.command_list = self.wTree.get_object("liststore1") + self.selection = self.wTree.get_object("treeview-selection1") + self.remove_button = self.wTree.get_object("toolbutton2") + self.plugin_file = os.path.join(pluginfolder, "Commands.config") + c_file = open(self.plugin_file, "r") + self.lines = ''.join(c_file.readlines()) + c_file.close() + old_items = re.search("dataitems=(.*)", self.lines).group(1).split(",") + old_commands = re.search("scripts=(.*)", self.lines).group(1).split(",") + for i in xrange(len(old_items)): + myiter = self.command_list.insert_after(None, None) + self.command_list.set_value(myiter, 0, '$'+old_items[i]) + self.command_list.set_value(myiter, 1, old_commands[i]) + # Select first item in list + self.selection.select_path(self.command_list.get_path(self.command_list.get_iter_first())) + if old_items == ['']: + old_items = [] + old_command = [] + self.on_remove_clicked(self.remove_button) + + '''On Clicking Ok''' + def on_ok_clicked(self, widget, data=None): + new_item_list = '' + new_command_list = '' + item = self.command_list.get_iter_first() + dataitems = {} + if item: + while item: + if self.command_list.get_value(item, 0)[1:] in dataitems: + self.selection.select_path(self.command_list.get_path(item)) + self.item_entry.set_text(self.item_entry.get_text() + 'NamesMustBeUnique') + return + else: + dataitems[self.command_list.get_value(item, 0)[1:]]=True + comma = ',' + if new_item_list == '': + comma = '' + new_item_list = self.command_list.get_value(item, 0)[1:] + comma + new_item_list + new_command_list = self.command_list.get_value(item, 1) + comma + new_command_list + item = self.command_list.iter_next(item) + self.lines = "dataitems=" + new_item_list + "\nscripts=" + new_command_list + c_file = open(self.plugin_file, "w") + c_file.write(self.lines) + c_file.close() + self.on_window_destroy(self) + + '''On Clicking Add''' + def on_add_clicked(self, widget, data=None): + myiter = self.command_list.append() + self.command_list.set_value(myiter, 0, '$newitem') + self.command_list.set_value(myiter, 1, 'echo "newitem"') + self.selection.select_path(self.command_list.get_path(myiter)) + self.item_entry.set_sensitive(True) + self.command_entry.set_sensitive(True) + self.remove_button.set_sensitive(True) + + '''On pressing delete in the list''' + def on_remove_clicked(self, widget, data=None): + model, paths = self.selection.get_selected_rows() + position_selected = self.command_list.get_iter_from_string(str(paths[0][0])) + pos = self.command_list.get_path(position_selected)[0] + if pos == 0: + newpos = (1,) + else: + newpos = (pos-1,) + self.selection.select_path(newpos) + self.command_list.remove(position_selected) + + '''On Changing the item entry''' + def on_itementry_changed(self, widget, data=None): + model, paths = self.selection.get_selected_rows() + try: + position_selected = self.command_list.get_iter_from_string(str(paths[0][0])) + except: # setting to blank in exception in on_selection_changed + return + self.command_list.set_value(position_selected, 0, '$'+widget.get_text()) + + '''On Changing the command entry''' + def on_commandentry_changed(self, widget, data=None): + model, paths = self.selection.get_selected_rows() + try: + position_selected = self.command_list.get_iter_from_string(str(paths[0][0])) + except: # setting to blank in exception in on_selection_changed + return + self.command_list.set_value(position_selected, 1, widget.get_text()) + + '''On changing selection in command list''' + def on_selection_changed(self, widget, data=None): + model, paths = self.selection.get_selected_rows() + try: + position_selected = self.command_list.get_iter_from_string(str(paths[0][0])) + except: # empty list + self.item_entry.set_text("") + self.command_entry.set_text("") + self.item_entry.set_sensitive(False) + self.command_entry.set_sensitive(False) + self.remove_button.set_sensitive(False) + return + dataitem = self.command_list.get_value(position_selected, 0) + command = self.command_list.get_value(position_selected, 1) + self.item_entry.set_text(dataitem[1:]) + self.command_entry.set_text(command) + + '''On Clicking Cancel''' + def on_cancel_clicked(self, widget, data=None): + self.on_window_destroy(self) + + '''Exit''' + def on_window_destroy(self, widget, data=None): + self.window.destroy() + gtk.main_quit() + + '''Run the GUI''' + def main(self): + gtk.main() diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Commands/run_commands.sh wakeup-1.2/data/wakeup/plugin_scripts/Commands/run_commands.sh --- wakeup-1.1/data/wakeup/plugin_scripts/Commands/run_commands.sh 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/plugin_scripts/Commands/run_commands.sh 2012-01-03 12:29:44.000000000 -0800 @@ -0,0 +1,20 @@ +#!/bin/bash +# Run user-defined commands +# Copyright (C) 2012 David Glass +# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 + +IFS=, +plugin_file=/home/$1/.wakeup/$ALARM/plugins/Commands/Commands.config +dataitems=($(sed -rn 's/dataitems\s*=\s*(.*)\s*$/\1/p' $plugin_file)) +scripts=($(sed -rn 's/scripts\s*=\s*(.*)\s*$/\1/p' $plugin_file)) + +# Make hash of dataitems->scripts +declare -A itemscripts +for (( i = 0; i < ${#dataitems[@]}; i++ )); do + itemscripts[${dataitems[$i]}]=${scripts[$i]} +done + +# Execute scripts and output any text output properly +for item in ${*:2}; do + eval ${itemscripts[$item]} 2>/dev/null; echo "" +done diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/DateTime/DateTime.py wakeup-1.2/data/wakeup/plugin_scripts/DateTime/DateTime.py --- wakeup-1.1/data/wakeup/plugin_scripts/DateTime/DateTime.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/DateTime/DateTime.py 2012-01-03 12:30:07.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for DateTime -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/DateTime/date_time.sh wakeup-1.2/data/wakeup/plugin_scripts/DateTime/date_time.sh --- wakeup-1.1/data/wakeup/plugin_scripts/DateTime/date_time.sh 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/DateTime/date_time.sh 2012-01-03 12:29:59.000000000 -0800 @@ -1,6 +1,6 @@ #!/bin/bash # plugin script for DateTime outputting current date and/or time -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 plugin_file=/home/$1/.wakeup/$ALARM/plugins/DateTime/DateTime.config diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/EvolutionData/EvolutionData.py wakeup-1.2/data/wakeup/plugin_scripts/EvolutionData/EvolutionData.py --- wakeup-1.1/data/wakeup/plugin_scripts/EvolutionData/EvolutionData.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/EvolutionData/EvolutionData.py 2012-01-03 12:30:29.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for EvolutionData -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/EvolutionData/read_evolution.py wakeup-1.2/data/wakeup/plugin_scripts/EvolutionData/read_evolution.py --- wakeup-1.1/data/wakeup/plugin_scripts/EvolutionData/read_evolution.py 2011-10-16 10:46:25.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/EvolutionData/read_evolution.py 2012-01-05 13:39:02.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/python # plugin script for EvolutionData outputting schedule and/or tasks -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import evolution, urllib, vobject, datetime, dateutil @@ -47,13 +47,19 @@ parsedEvent = ev start = parsedEvent.dtstart.value if hasattr(parsedEvent, "rrule"): - rrule = parsedEvent.rrule.value - recurrences = dateutil.rrule.rrulestr(rrule, dtstart=start) - for day in recurrences: - if day.date() == today: - todays_events.append(parsedEvent) - if day.date() > today: - break + try: + rrule = parsedEvent.rrule.value + rrule_until = re.search("UNTIL=[A-Za-z0-9]+",rrule) + if rrule_until and rrule_until.group(0)[-1] == "Z": # some weird dateutil error in time zones + rrule = re.sub(rrule_until.group(0), rrule_until.group(0)[:-1], rrule) + recurrences = dateutil.rrule.rrulestr(rrule, dtstart=start) + for day in recurrences: + if day.date() == today: + todays_events.append(parsedEvent) + if day.date() > today: + break + except TypeError: + pass # some weird dateutil error in time zones, just in case it's still missed elif type(start) == datetime.date and start == today: d=parsedEvent.dtstart.value parsedEvent.dtstart.value = datetime.datetime.combine(d, datetime.time(0,0,0,0)) @@ -67,7 +73,7 @@ continue for td in todos.get_all_objects(): parsedTd = vobject.readOne(td.get_as_string()) - if hasattr(parsedTd, "percent_complete") and parsedTd.percent_complete != "100": + if not (hasattr(parsedTd, "percent_complete") and parsedTd.percent_complete == "100"): todo_list.append(parsedTd) for out in to_output: diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/EvolutionData/read_evolution.sh wakeup-1.2/data/wakeup/plugin_scripts/EvolutionData/read_evolution.sh --- wakeup-1.1/data/wakeup/plugin_scripts/EvolutionData/read_evolution.sh 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/EvolutionData/read_evolution.sh 2012-01-03 12:30:50.000000000 -0800 @@ -1,6 +1,6 @@ #!/bin/bash # wrapper for read_evolution.py that removes unwanted DEBUG and newlines -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 $(dirname $0)/read_evolution.py $* 2>/dev/null | sed -r '/.*DEBUG.*/d' | sed -r ':a;N;$!ba;s/\n{3,}//g' diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/GmailCounter/check_gmail.sh wakeup-1.2/data/wakeup/plugin_scripts/GmailCounter/check_gmail.sh --- wakeup-1.1/data/wakeup/plugin_scripts/GmailCounter/check_gmail.sh 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/GmailCounter/check_gmail.sh 2012-01-14 19:40:49.000000000 -0800 @@ -1,17 +1,18 @@ #!/bin/bash # plugin script for GmailCounter outputting number of new emails on a gmail account. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 eval $(cat /home/$1/.wakeup/$ALARM/plugins/GmailCounter/GmailCounter.config); password=$(echo $password | base64 -d) -tmpfile=/tmp/gmailcheck_tmp -curl -u $username:$password --silent "https://mail.google.com/mail/feed/atom" \ +IFS=$'\n' +times=($(curl -u $username:$password --silent "https://mail.google.com/mail/feed/atom" \ | grep -P ".*" | sed -r 's/(.*)T24:(.*)/\1T0:\2/' \ - | sed -r 's/(.*)T(.*)Z<\/issued>/date +%s --date "\1 \2"/' > $tmpfile -chmod +x $tmpfile -times=($($tmpfile)) + | sed -r 's/(.*)T(.*)Z<\/issued>/date +%s --date "\1 \2"/')) +for (( i = 0; i < ${#times[@]}; i++ )); do + times[$i]=$(date +%s -d ${times[$i]}) +done last_checked=$(curl -u $username:$password --silent \ "https://mail.google.com/mail/feed/atom" | grep -m 1 "" \ | sed -r 's/(.*)T24:(.*)/\1T0:\2/' \ @@ -25,7 +26,5 @@ fi done -rm $tmpfile - plural="s"; if [[ $num_new_emails == 1 ]]; then plural=""; fi echo "$num_new_emails new e-mail$plural" diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/GmailCounter/GmailCounter.py wakeup-1.2/data/wakeup/plugin_scripts/GmailCounter/GmailCounter.py --- wakeup-1.1/data/wakeup/plugin_scripts/GmailCounter/GmailCounter.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/GmailCounter/GmailCounter.py 2012-01-03 12:31:39.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for GmailCounter -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.py wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.py --- wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.py 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.py 2012-01-05 09:55:38.000000000 -0800 @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# get hebcal data +# Copyright (C) 2012 David Glass +# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 + +import re +import sys, os +import subprocess + + +# Get preferences +plugin_file = open('/home/' + sys.argv[1] + '/.wakeup/' + os.environ['ALARM'] + '/plugins/HebrewCalendar/HebrewCalendar.config', 'r') +plugin_text = ''.join(plugin_file.readlines()) +plugin_file.close() +latitude = re.search("latitude=(.*)", plugin_text).group(1) +longitude = re.search("longitude=(.*)", plugin_text).group(1) +manual_location = re.search("manual_location=(.*)", plugin_text).group(1) + +# Output +for out in sys.argv[2:len(sys.argv)]: + if (out == "hebdate"): + date = subprocess.check_output(['hebcal', '-Th']) + print date + '\n' + if (out == "hebcalevents"): + if (manual_location == "false"): + # Get location + sys.path.append('/usr/share/wakeup') + import location + loc = location.get_location() + latitude = float(loc['latitude']) + longitude = float(loc['longitude']) + else: + latitude = float(latitude) + longitude = float(longitude) + # Convert to hebcal +/-deg,min + lat_deg = int(abs(latitude)) + lat_min = int(60 * (abs(latitude) - lat_deg)) + lat_deg = int(latitude/abs(latitude)) * lat_deg + lon_deg = int(abs(longitude)) + lon_min = int(60 * (abs(longitude) - lon_deg)) + lon_deg = -1 * int(longitude/abs(longitude)) * lon_deg + latitude = str(lat_deg) + ',' + str(lat_min) + longitude = str(lon_deg) + ',' + str(lon_min) + zone = subprocess.check_output(['date','+%:::z']) + events = subprocess.check_output(['hebcal', '-Toc', '-l', latitude, '-L', longitude, '-z', zone]) + events = re.sub("^[0-9].*\n", "", events) + print events + '\n' diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.sh wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.sh --- wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.sh 2011-10-16 10:46:25.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/check_hebcal.sh 1969-12-31 16:00:00.000000000 -0800 @@ -1,25 +0,0 @@ -#!/bin/bash -# plugin script for HebrewCalendar outputting Hebrew date and/or events -# Copyright (C) 2011 David Glass -# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 - -plugin_file="/home/$1/.wakeup/$ALARM/plugins/HebrewCalendar/HebrewCalendar.config" -manual_location=$(sed -rn 's/manual_location\s*=\s*(.*)\s*/\1/p' $plugin_file) -lat=$(sed -rn 's/latitude\s*=\s*(.*)\s*/\1/p' $plugin_file) -long=$(sed -rn 's/longitude\s*=\s*(.*)\s*/\1/p' $plugin_file) -for i in ${*:2}; do - if [[ $i == hebdate ]]; then - echo $(hebcal -Th); echo "" - fi - if [[ $i == hebcalevents ]]; then - if [[ $manual_location == "false" ]]; then - latln=$(wget -q -U DummyBrowser/1.0 -O - www.ip-adress.com/ip_tracer | grep GLatLng) - lat=$(echo $latln | grep -oP "\([0-9\-\.]+" | sed 's/(//') - long=$(echo $latln | grep -oP "[0-9\-\.]+\)" | sed 's/)//') - fi - # put longitude and latitude in deg,min format. Hebcal requires that longitude sign is switched - lat=$(echo $lat | perl -ne '$lat = abs($_); $deg = int($lat); $min = int(60 * ($lat - $deg)); print "$deg,$min"') - long=$(echo $long | perl -ne '$long = abs($_); $deg = int($long); $min = int(60 * ($long - $deg)); $deg *= -1 if not /-/; print "$deg,$min"') - echo $(hebcal -Toc -l $lat -L $long -z $(date +%:::z) | sed /^[0-9].*/d); echo "" - fi -done diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.glade wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.glade --- wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.glade 2011-05-22 10:43:25.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.glade 2011-12-26 20:08:14.000000000 -0800 @@ -1,7 +1,6 @@ - True False @@ -17,7 +16,7 @@ False - Manually set longitude, latitude: + Manually set decimal longitude, latitude: True True False @@ -42,8 +41,6 @@ False False - True - True True @@ -70,8 +67,6 @@ False False - True - True True diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.py wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.py --- wakeup-1.1/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.py 2011-05-24 11:02:12.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/HebrewCalendar/HebrewCalendar.py 2012-01-03 12:32:26.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for Hebrew Calendar -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk @@ -49,11 +49,10 @@ self.window = parent threading.Thread.__init__(self) def run(self): - self.window.LonLat = commands.getoutput('wget -q -U DummyBrowser/1.0 -O - www.ip-adress.com/ip_tracer | grep GLatLng | grep -oP "[0-9\.\-, ]{2,}"') - lon = re.search("^[0-9\.\-]+", self.window.LonLat).group(0) - lat = re.search("[0-9\.\-]+$", self.window.LonLat).group(0) - self.window.longitude.set_text(lon) - self.window.latitude.set_text(lat) + import location + loc = location.get_location() + self.window.longitude.set_text(loc['longitude']) + self.window.latitude.set_text(loc['latitude']) '''On Checking to set weather ID manually''' @@ -71,12 +70,6 @@ lon="" lat="" manual_location = "false" - #self.lines = re.sub("longitude\s*=\s*.*\s*", "longitude=" \ - # + lon + "\n", self.lines) - #self.lines = re.sub("latitude\s*=\s*.*\s*", "latitude=" \ - # + lat + "\n", self.lines) - #self.lines = re.sub("manual_location\s*=\s*.*\s*", "manual_location=" \ - # + manual_location + "\n", self.lines) hc_file = open(self.plugin_file, "w") hc_file.write("longitude=" + lon + "\n") hc_file.write("latitude=" + lat + "\n") diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/LastfmPlayer/LastfmPlayer.py wakeup-1.2/data/wakeup/plugin_scripts/LastfmPlayer/LastfmPlayer.py --- wakeup-1.1/data/wakeup/plugin_scripts/LastfmPlayer/LastfmPlayer.py 2011-05-23 06:30:54.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/LastfmPlayer/LastfmPlayer.py 2012-01-03 12:32:42.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for LastfmPlayer -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/LastfmPlayer/play_lastfm.sh wakeup-1.2/data/wakeup/plugin_scripts/LastfmPlayer/play_lastfm.sh --- wakeup-1.1/data/wakeup/plugin_scripts/LastfmPlayer/play_lastfm.sh 2011-05-23 06:48:34.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/LastfmPlayer/play_lastfm.sh 2012-01-05 13:47:16.000000000 -0800 @@ -1,8 +1,10 @@ #!/bin/bash # plugin script for LastfmPlayer, a wrapper for shell-fm -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 +trap "killall shell-fm; exit" SIGHUP SIGINT SIGTERM + export HOME=/home/$1 plugin_file=~/.shell-fm/shell-fm.rc duration=$(sed -rn 's/#duration\s*=\s*(.*)\s*/\1/p' $plugin_file) diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/MusicPlayer/MusicPlayer.py wakeup-1.2/data/wakeup/plugin_scripts/MusicPlayer/MusicPlayer.py --- wakeup-1.1/data/wakeup/plugin_scripts/MusicPlayer/MusicPlayer.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/MusicPlayer/MusicPlayer.py 2012-01-03 12:32:59.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for MusicPlayer -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/MusicPlayer/play_music.sh wakeup-1.2/data/wakeup/plugin_scripts/MusicPlayer/play_music.sh --- wakeup-1.1/data/wakeup/plugin_scripts/MusicPlayer/play_music.sh 2011-05-23 06:09:28.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/MusicPlayer/play_music.sh 2012-01-05 13:51:42.000000000 -0800 @@ -1,12 +1,13 @@ #!/bin/bash # plugin script for MusicPlayer, which plays a given file with mpg123 -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 +trap "killall mpg123; exit" SIGHUP SIGINT SIGTERM + plugin_file=/home/$1/.wakeup/$ALARM/plugins/MusicPlayer/MusicPlayer.config MUSIC=$(sed -rn 's/music_file\s*=\s*(.*)\s*$/\1/p' $plugin_file) ENDPOS=$(sed -rn 's/time\s*=\s*(.*)\s*$/\1/p' $plugin_file) -echo "hello: $ENDPOS" # note making volume 3/4 is a hack to make the music volume equal the # low festival volume. It only needs to be done when not logged in. if [[ `who` == "" ]]; then diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/News/News.py wakeup-1.2/data/wakeup/plugin_scripts/News/News.py --- wakeup-1.1/data/wakeup/plugin_scripts/News/News.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/News/News.py 2012-01-03 12:33:13.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for News -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/News/read_news.py wakeup-1.2/data/wakeup/plugin_scripts/News/read_news.py --- wakeup-1.1/data/wakeup/plugin_scripts/News/read_news.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/News/read_news.py 2012-01-05 11:24:32.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin script for News outputting news items from an rss feed -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import feedparser @@ -18,7 +18,7 @@ feed = feedparser.parse(rss_url) j = 1; for i in feed.entries: - print i.title + ".\n" + print i.title + ". ", if j >= max_feeds: break j = j + 1 diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Weather/format_weather.pl wakeup-1.2/data/wakeup/plugin_scripts/Weather/format_weather.pl --- wakeup-1.1/data/wakeup/plugin_scripts/Weather/format_weather.pl 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/Weather/format_weather.pl 1969-12-31 16:00:00.000000000 -0800 @@ -1,62 +0,0 @@ -#!/usr/bin/perl -# helper script for get_weather.sh that formats weather from weather-util -# Copyright (C) 2011 David Glass -# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 - -my $plugin_file = "/home/$ARGV[1]/.wakeup/$ARGV[2]/plugins/Weather/Weather.config"; -open(my $file, $plugin_file); -my @lines = <$file>; -my @temp_line = grep(/^temperature_units/, @lines); -my @wind_line = grep(/^wind_units/, @lines); -(my $blank, my $temp_units) = split(/\s*=\s*/, $temp_line[0]); -$temp_units =~ s/\s*$//; -(my $blank, my $wind_units) = split(/\s*=\s*/, $wind_line[0]); -$wind_units =~ s/\s*$//; -close($file); - -my $weather = `weather -qi $ARGV[0]`; -$_ = $weather; -s/\n/.\n/g; # put periods to distinguish sentences -s/;/ and /g; # ; is used as an "and" -s/SE / south east /g; # directions, including NNE, SSW, etc. -s/NE / north east /g; -s/NW / north west /g; -s/SW / south west /g; -s/N /north /g; -s/E /east /g; -s/W /west /g; -s/S /south /g; -s/\(.*? degrees\)//g; # remove exact direction -if ($wind_units eq "mph") { -s/MPH \(.*? KT\)/miles per hour/g; # write out MPH, remove KT -} -else { -s/[0-9\.\-]*? MPH \((.*?) KT\)/\1 knots/g; # write out KT, remove MPH -} -if ($temp_units eq "F") { -s/F \(.*? C\)/degrees/g; # remove C, only prints degrees -} -else { -s/[0-9\.\-]*? F \((.*?) C\)/\1 degrees/g; # remove F, only prints degrees -} -s/ / /g; # clean up spaces - -# set up for splitting into array -s/.\n/|/g; -s/: /|/g; - -my $bl = "", $temperature = "", $humidity = "", $weather = "", $sky = ""; -if (/Weather/) { - ($bl,$temp,$bl, $hum,$bl, $wind,$bl, $weather,$bl, $sky) = split(/\|/, $_); -} -else { - ($bl,$temp,$bl, $hum,$bl, $wind, $bl, $sky) = split(/\|/, $_); -} - -for my $to_output (@ARGV[3..$#ARGV]) { - if ($to_output eq "temperature") {print "$temp\n\n";} - if ($to_output eq "skyconditions") {print "$sky\n\n";} - if ($to_output eq "humidity") {print "$hum\n\n";} - if ($to_output eq "windconditions") {print "$wind\n\n";} - if ($to_output eq "weatherconditions") {print "$weather\n\n";} -} diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Weather/get_weather.py wakeup-1.2/data/wakeup/plugin_scripts/Weather/get_weather.py --- wakeup-1.1/data/wakeup/plugin_scripts/Weather/get_weather.py 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/plugin_scripts/Weather/get_weather.py 2012-01-15 11:50:19.000000000 -0800 @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# get weather for Weather +# Copyright (C) 2012 David Glass +# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 + +import re +import pywapi +import sys, os + +# Get unit preferences +plugin_file = open('/home/' + sys.argv[1] + '/.wakeup/' + os.environ['ALARM'] + '/plugins/Weather/Weather.config', 'r') +plugin_text = ''.join(plugin_file.readlines()) +plugin_file.close() +temp_unit = re.search("temperature_units=(.*)", plugin_text).group(1) +wind_unit = re.search("wind_units=(.*)", plugin_text).group(1) +if (wind_unit == "mph"): + wind_unit = "miles per hour" +manual_location = re.search("location=(.*)", plugin_text).group(1) + +if (manual_location != 'none'): + # Using manual location + weather = pywapi.get_weather_from_google(manual_location) +else: + # Get location + sys.path.append('/usr/share/wakeup') + import location + loc = location.get_location() + weather = pywapi.get_weather_from_google(loc['City']+','+loc['State']+','+loc['Country']) + + +# Output the weather +for out in sys.argv[2:len(sys.argv)]: + if (out == "temperature"): + if temp_unit == "C": + print weather['current_conditions']['temp_c'] + '\n' + else: + print weather['current_conditions']['temp_f'] + '\n' + if (out == "skyconditions"): + print weather['current_conditions']['condition'] + '\n' + if (out == "humidity"): + print re.sub("Humidity: ", "", weather['current_conditions']['humidity']) + '\n' + if (out == "windconditions"): + winds = weather['current_conditions']['wind_condition'] + magnitude = re.search("at (.*) mph", winds).group(1) + direction = re.search("Wind: (.*) at", winds).group(1) + direction = re.sub("N", "north ", direction) + direction = re.sub("E", "east ", direction) + direction = re.sub("S", "south ", direction) + direction = re.sub("W", "west ", direction) + if wind_unit == "knots": + magnitude = int(round(float(magnitude) * 0.868976242)) + print direction + " at " + str(magnitude) + " " + wind_unit + '\n' + if (out == "high"): + high = int(weather['forecasts'][0]['high']) + if temp_unit == "C": + print str(int(round((high - 32)*5/9))) + '\n' + else: + print str(high) + '\n' + if (out == "low"): + low = int(weather['forecasts'][0]['low']) + if temp_unit == "C": + print str(int(round((low - 32)*5/9))) + '\n' + else: + print str(low) + '\n' + if (out == "todays_forecast"): + print weather['forecasts'][0]['condition'] + '\n' diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Weather/get_weather.sh wakeup-1.2/data/wakeup/plugin_scripts/Weather/get_weather.sh --- wakeup-1.1/data/wakeup/plugin_scripts/Weather/get_weather.sh 2011-05-20 08:05:47.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/Weather/get_weather.sh 1969-12-31 16:00:00.000000000 -0800 @@ -1,12 +0,0 @@ -#!/bin/bash -# plugin script for Weather outputting various weather conditions -# Copyright (C) 2011 David Glass -# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 - -plugin_file="/home/$1/.wakeup/$ALARM/plugins/Weather/Weather.config" -manual_location=$(sed -rn 's/location\s*=\s*(.*)\s*/\1/p' $plugin_file) -if [[ $manual_location == "none" ]]; then - $(dirname $0)/format_weather.pl $($(dirname $0)/id_by_ip.sh) $1 $ALARM ${*:2} -else - $(dirname $0)/format_weather.pl $manual_location $1 $ALARM ${*:2} -fi diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Weather/id_by_ip.sh wakeup-1.2/data/wakeup/plugin_scripts/Weather/id_by_ip.sh --- wakeup-1.1/data/wakeup/plugin_scripts/Weather/id_by_ip.sh 2011-09-23 08:34:07.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/Weather/id_by_ip.sh 1969-12-31 16:00:00.000000000 -0800 @@ -1,66 +0,0 @@ -#!/bin/bash -# plugin script for Weather to get closest metar station based on ip geolocation -# Copyright (C) 2011 David Glass -# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 - -# Get ISP longitude and latitude, as well as country code and state -wget -q -U DummyBrowser/1.0 -O /tmp/ip_tracer www.ip-adress.com/ip_tracer -latln=$(grep GLatLng /tmp/ip_tracer) -my_lat=$(echo $latln | grep -oP "\([0-9\-\.]+" | sed 's/(//') -my_lon=$(echo $latln | grep -oP "[0-9\-\.]+\)" | sed 's/)//') -countrycode=$(grep -A 2 "country code" /tmp/ip_tracer | grep -oP "[A-Z]{2}" | sed '/IP/d') -state=$(grep -A 2 "state" /tmp/ip_tracer | tr '\n' ' ' | grep -oP ".*" | sed -r 's/\s*<\/?td>\s*//g') -rm /tmp/ip_tracer - -# filter metar stations by country, or by state if in United States or Canada -wget -q http://aviationweather.gov/adds/metars/stations.txt -O /tmp/metar_stations -if [[ $countrycode == "US" || $countrycode == "CA" ]]; then - statecode=$(grep -i -A 2 "$state" /tmp/metar_stations | grep -P "US$|CA$" | grep -oP "^[A-Z]{2}") - grep "^$statecode" /tmp/metar_stations > /tmp/Stations -else - grep "$countrycode$" /tmp/metar_stations > /tmp/Stations -fi -rm /tmp/metar_stations - -# find closest metar station -distance=40000.0 # km, approximate circumference of the earth (starting minimum dist) -my_metar="" -while IFS='' read line; do - # skip useless lines - if [[ $line =~ ^!.* || $line =~ ^$ ]]; then flag=1; continue - elif [[ $flag == 1 ]]; then flag=0; continue - elif [[ $line =~ " ICAO " ]]; then continue - fi - - # get metar ID and skip metar stations without ID - id=${line:20:4} - if [[ $id == " " ]]; then continue; fi - # convert longitude and latitude to decimal format - lat=${line:39:6} - lon=${line:47:7} - lat_deg=$(echo "${lat:0:2}" | sed 's/^0//') - lat_min=$(echo "${lat:3:2}" | sed 's/^0//') - lat_sign=$(if [[ ${lat:5:1} == "S" ]]; then echo "-"; fi) - lon_deg=$(echo "${lon:0:3}" | sed 's/^0//') - lon_min=$(echo "${lon:4:2}" | sed 's/^0//') - lon_sign=$(if [[ ${lon:6:1} == "W" ]]; then echo "-"; fi) - lat_dec="$lat_sign$lat_deg.$(( 10000 * lat_min / 60 ))" - lon_dec="$lon_sign$lon_deg.$(( 10000 * lon_min / 60 ))" - - # find shortest distance - d=$($(dirname $0)/sphereDist.pl $my_lat $my_lon $lat_dec $lon_dec) - d_whole=$(echo $d | grep -oP "^[0-9]+") - d_dec=$(echo $d | grep -oP "[0-9]+$") - dist_whole=$(echo $distance | grep -oP "^[0-9]+") - dist_dec=$(echo $distance | grep -oP "[0-9]+$") - if [[ $d_whole -lt $dist_whole - || ($d_whole -eq $dist_whole && ${d_dec:1:4} < ${dist_dec:1:4}) ]]; then - distance=$d - my_metar=$id - min_lat=$lat_dec - min_lon=$lon_dec - fi -done < /tmp/Stations -# output closest metar station -echo "$my_metar" -rm /tmp/Stations diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Weather/sphereDist.pl wakeup-1.2/data/wakeup/plugin_scripts/Weather/sphereDist.pl --- wakeup-1.1/data/wakeup/plugin_scripts/Weather/sphereDist.pl 2011-05-20 07:21:12.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/Weather/sphereDist.pl 1969-12-31 16:00:00.000000000 -0800 @@ -1,26 +0,0 @@ -#!/usr/bin/perl -# plugin script for determining closest metar station. This finds distance -# between two latitude, longitude points (+/- decimal format) -# Copyright (C) 2011 David Glass -# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 -# See http://en.wikipedia.org/wiki/Haversine_formula - -use Math::Trig; - -$lat1 = $ARGV[0]; -$lon1 = $ARGV[1]; -$lat2 = $ARGV[2]; -$lon2 = $ARGV[3]; -$R = 6378; # km, earth's radius assuming perfect sphere -$havdoverR = &haversin($lat2 - $lat1) + cos($lat1)*cos($lat2)*&haversin($lon2-$lon1); -$distance = $R * &archaversin($havdoverR) * 3.14/180; - - -sub haversin { - return (1 - cos(@_[0]))/2; -} -sub archaversin { - return acos(1 - 2 * @_[0]); -} - -print $distance; diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Weather/Weather.glade wakeup-1.2/data/wakeup/plugin_scripts/Weather/Weather.glade --- wakeup-1.1/data/wakeup/plugin_scripts/Weather/Weather.glade 2011-05-22 10:44:07.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/Weather/Weather.glade 2011-12-26 20:08:14.000000000 -0800 @@ -1,7 +1,6 @@ - @@ -52,7 +51,7 @@ 3 - Manually set location ID: + Manually set location (e.g.: city,state): True True False @@ -69,8 +68,6 @@ False False - True - True 1 diff -Nru wakeup-1.1/data/wakeup/plugin_scripts/Weather/Weather.py wakeup-1.2/data/wakeup/plugin_scripts/Weather/Weather.py --- wakeup-1.1/data/wakeup/plugin_scripts/Weather/Weather.py 2011-05-23 12:10:54.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_scripts/Weather/Weather.py 2012-01-15 11:52:20.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python # plugin GUI preferences class for Weather -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk @@ -47,9 +47,9 @@ self.location = manual_id threading.Thread.__init__(self) def run(self): - ip_script = '/usr/share/wakeup/plugin_scripts/Weather/id_by_ip.sh' - ip_process = subprocess.Popen(ip_script, stdout=subprocess.PIPE) - self.location.set_text(ip_process.communicate()[0][:-1]) + import location + loc = location.get_location() + self.location.set_text(loc['City']+','+loc['State']+','+loc['Country']) '''On Checking to set weather ID manually''' diff -Nru wakeup-1.1/data/wakeup/plugin_settings/Commands.plugin wakeup-1.2/data/wakeup/plugin_settings/Commands.plugin --- wakeup-1.1/data/wakeup/plugin_settings/Commands.plugin 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/plugin_settings/Commands.plugin 2011-12-26 20:08:14.000000000 -0800 @@ -0,0 +1,23 @@ +(dp0 +S'description' +p1 +S'Run arbitrary command' +p2 +sS'script' +p3 +S'Commands/run_commands.sh' +p4 +sS'text_output' +p5 +I01 +sS'data_items' +p6 +(lp7 +sS'has_preferences' +p8 +I01 +sS'name' +p9 +S'Commands' +p10 +s. \ No newline at end of file diff -Nru wakeup-1.1/data/wakeup/plugin_settings/HebrewCalendar.plugin wakeup-1.2/data/wakeup/plugin_settings/HebrewCalendar.plugin --- wakeup-1.1/data/wakeup/plugin_settings/HebrewCalendar.plugin 2011-05-22 10:13:32.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_settings/HebrewCalendar.plugin 2011-12-26 20:08:14.000000000 -0800 @@ -5,7 +5,7 @@ p2 sS'script' p3 -S'HebrewCalendar/check_hebcal.sh' +S'HebrewCalendar/check_hebcal.py' p4 sS'text_output' p5 diff -Nru wakeup-1.1/data/wakeup/plugin_settings/Weather.plugin wakeup-1.2/data/wakeup/plugin_settings/Weather.plugin --- wakeup-1.1/data/wakeup/plugin_settings/Weather.plugin 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/plugin_settings/Weather.plugin 2011-12-26 20:08:14.000000000 -0800 @@ -5,7 +5,7 @@ p2 sS'script' p3 -S'Weather/get_weather.sh' +S'Weather/get_weather.py' p4 sS'text_output' p5 @@ -19,15 +19,19 @@ p9 aS'skyconditions' p10 -aS'weatherconditions' -p11 aS'windconditions' +p11 +aS'high' p12 -asS'has_preferences' +aS'low' p13 +aS'todays_forecast' +p14 +asS'has_preferences' +p15 I01 sS'name' -p14 +p16 S'Weather' -p15 +p17 s. \ No newline at end of file diff -Nru wakeup-1.1/data/wakeup/setnextalarm.py wakeup-1.2/data/wakeup/setnextalarm.py --- wakeup-1.1/data/wakeup/setnextalarm.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/setnextalarm.py 2012-01-15 00:45:12.000000000 -0800 @@ -1,7 +1,7 @@ #!/usr/bin/env python # Using setalarm, finds the earliest alarm in the future which requires # a computer wakeup and sets the computer to wake up and run that alarm. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import sys @@ -11,7 +11,7 @@ wakeup_folder = "/usr/share/wakeup/" sys.path.append(wakeup_folder) from alarm import alarm -from commands import getstatusoutput +import subprocess thisscript = os.path.join(wakeup_folder, "setnextalarm.py") + " " + sys.argv[1] setalarm_script = "/usr/bin/setalarm" @@ -37,52 +37,54 @@ for alarm in alarms: cronstring = alarm.get_property("cronvalue") cronstring = re.sub("\*", '"*"', cronstring) - [status, output] = getstatusoutput(setalarm_script + " -p -c " + \ - cronstring + " -o 0") - if status == 0: + crontimes.append(re.sub('"', '', cronstring)) + try: + output = subprocess.check_output([setalarm_script, '-p', '-c'] + re.split(' ', cronstring) + ['-o', '0']) alarmtimes.append(output) - crontimes.append(re.sub('"', '', cronstring)) - elif output == "The specified cron time does not occur within a year": - del alarms[alarms.index(alarm)] - else: - print "Unable to set alarms. Some crontimes are invalid." + except subprocess.CalledProcessError as e: + if e.output == "The specified cron time does not occur within a year\n": + print "A specified cron time does not occur within a year; please check preferences." + else: + print "Unable to set alarms. Some crontimes are invalid." exit(1) # If no alarms in list, clear root's cron file and unset computer wakeup if len(alarms) == 0: - [status1, output] = getstatusoutput('tmpfile=/tmp/setnextalarm_tmp.txt\n' + \ - 'sudo crontab -l > $tmpfile\n' + \ - 'sed -i /^.*setnextalarm.*$/d $tmpfile\n' + \ - 'sudo crontab $tmpfile\n' + \ - 'rm $tmpfile') - [status2, output] = getstatusoutput('sudo ' + setalarm_script + ' -u 0') + curcron = subprocess.check_output(['sudo', 'crontab', '-l']) + curcron = re.sub('[^\n]*setnextalarm.*\n', '', curcron) + updatecron = subprocess.Popen(['crontab', '-'], stdin = subprocess.PIPE) + updatecron.communicate(curcron) + subprocess.call(['sudo', setalarm_script, '-d']) exit() minalarm = min(alarmtimes) minindex = alarmtimes.index(minalarm) mincron = crontimes[minindex] # make sure the wakeup is preserved through shutdowns and at alarm times. Set alarms. -command = 'tmpfile=/tmp/setnextalarm_tmp.txt\n' + \ - 'sudo crontab -l > $tmpfile\n' + \ - 'sed -i /^.*setnextalarm.*$/d $tmpfile\n' + \ - 'echo \'' + mincron + ' DISPLAY=:0 ' + thisscript + \ - ' >/dev/null 2>&1\' >> $tmpfile\n' + \ - 'echo \'@reboot DISPLAY=:0 ' + thisscript + \ - ' >/dev/null 2>&1\' >> $tmpfile\n' +curcron = subprocess.check_output(['sudo', 'crontab', '-l']) +curcron = re.sub('[^\n]*setnextalarm.*\n', '', curcron) +updatecron = subprocess.Popen(['crontab', '-'], stdin = subprocess.PIPE) +newline1 = mincron + ' ' + thisscript + ' >/dev/null 2>&1\n' +newline2 = '@reboot ' + thisscript + ' >/dev/null 2>&1\n' +newcron = curcron + newline1 + newline2 for i in range(0, len(alarmtimes)): if alarmtimes[i] == minalarm: alarmnum = re.search("\d+$", alarmfolders[i]).group(0) - command += 'echo \'' + mincron + ' DISPLAY=:0 ' + \ - wakeup_script + " " + sys.argv[1] + " " + alarmnum + \ - ' >/dev/null 2>&1 #entered by setnextalarm\' >> $tmpfile\n' -command += 'sudo crontab $tmpfile\n' + \ - 'rm $tmpfile' -[status1, output] = getstatusoutput(command) -# set the computer to wake at the earliest of the wakeup times -[status2, output] = getstatusoutput('sudo ' + setalarm_script + ' -u ' + minalarm) -if status1 == 0 and status2 == 0: - [status, output] = getstatusoutput('date -d @' + minalarm) + newline = mincron + ' ' + wakeup_script + ' ' + sys.argv[1] + ' ' + alarmnum + \ + ' >/dev/null 2>&1 #entered by setnextalarm\n' + newcron = newcron + newline +updatecron.communicate(newcron) + +success = True +try: + subprocess.check_output(['sudo', setalarm_script, '-u', minalarm]) +except subprocess.CalledProcessError: + success = False +try: + output = subprocess.check_output(['date', '-d', '@' + minalarm]) print output -else: +except subprocess.CalledProcessError: + success = False +if not success: print "Unable to set alarms. Check alarm time preferences." exit(1) diff -Nru wakeup-1.1/data/wakeup/stopalarm.glade wakeup-1.2/data/wakeup/stopalarm.glade --- wakeup-1.1/data/wakeup/stopalarm.glade 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/stopalarm.glade 2011-12-27 11:00:54.000000000 -0800 @@ -1,38 +1,102 @@ - + - + + 100 + 1 + 5 + + + 59 + 5 + 1 + 10 + + False 5 + Stop Alarm False center appointment-new normal - False - + - + True + False 2 + + + True + False + end + + + Snooze + True + True + True + False + + + + False + False + 0 + + + + + gtk-stop + True + True + True + True + False + True + + + + False + False + 1 + + + + + False + True + 5 + end + 0 + + True + False True + False True + False 49 appointment-new + True + True 0 True + False Wakeup: press "stop" to end alarm or "snooze" to postpone. True @@ -53,13 +117,17 @@ True + False True + False 1 Snooze time: + True + True 5 0 @@ -68,7 +136,7 @@ True True - + adjustment1 True @@ -81,6 +149,7 @@ True + False hours @@ -94,7 +163,7 @@ True True - + adjustment2 True @@ -107,6 +176,7 @@ True + False minutes @@ -131,48 +201,6 @@ 1 - - - True - end - - - Snooze - True - True - True - - - - False - False - 0 - - - - - gtk-stop - True - True - True - True - True - - - - False - False - 1 - - - - - False - 5 - end - 0 - - @@ -180,15 +208,4 @@ button1 - - 100 - 1 - 5 - - - 5 - 59 - 1 - 10 - diff -Nru wakeup-1.1/data/wakeup/stopalarm.py wakeup-1.2/data/wakeup/stopalarm.py --- wakeup-1.1/data/wakeup/stopalarm.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/data/wakeup/stopalarm.py 2012-01-03 12:28:09.000000000 -0800 @@ -2,7 +2,7 @@ # Display GUI dialog from which the user can stop or snooze an alarm. # Output of the script is snooze time in minutes (0=stop). Output is # read by wakeup. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 import pygtk diff -Nru wakeup-1.1/data/wakeup/voice_list.sh wakeup-1.2/data/wakeup/voice_list.sh --- wakeup-1.1/data/wakeup/voice_list.sh 2011-05-23 12:25:55.000000000 -0700 +++ wakeup-1.2/data/wakeup/voice_list.sh 2012-01-14 23:28:54.000000000 -0800 @@ -1,12 +1,12 @@ #!/bin/bash # Output a list of "voicename\ndescription" for each voice available to # festival. Uses voice name as description if no description found. -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 -out1=/tmp/voice_out1 -out2=/tmp/voice_out2 -out3=/tmp/voice_out3 +out1=$(mktemp) +out2=$(mktemp) +out3=$(mktemp) echo "" > $out1; echo "" > $out2; echo "" > $out3 festival --server >/dev/null 2>&1 & diff -Nru wakeup-1.1/data/wakeup/wakeup.glade wakeup-1.2/data/wakeup/wakeup.glade --- wakeup-1.1/data/wakeup/wakeup.glade 2011-11-09 22:29:43.000000000 -0800 +++ wakeup-1.2/data/wakeup/wakeup.glade 2012-01-17 03:13:38.000000000 -0800 @@ -1,502 +1,360 @@ - + - - - - - - + + 110 + 5 + 10 + 10 - - - - - - - - - + + 23 + 8 + 1 + 5 - - - - - - - - Minute - - - Hour - - - Day - - - Week - - - Month - - + + 59 + 30 + 1 + 10 - - - - - - - - - - - + + 1 + 31 + 1 + 1 + 10 - - - - - - - - - + + 100 + 1 + 10 + 10 - - True - Wakeup Settings Configuration - center - 605 - 440 - appointment-new - - - + + False + 5 + Wakeup + True + center-on-parent + dialog + True + + + True - - + False + immediate + 2 + + True + False + center - - True - _File - True - - - True - - - gtk-new - True - True - True - - - - - - gtk-apply - True - True - True - - - - - - True - - - - - gtk-quit - True - True - True - - - - - - - - - - True - _Edit - True - - - True - - - gtk-preferences - True - True - True - - - - - - gtk-media-play - True - True - True - - - - - - gtk-remove - True - True - True - - - - - - - - - + + gtk-ok True - _Help - True - - - True - - - True - _Usage - True - - - - - - gtk-about - True - True - True - - - - - + True + True + False + True + + + False + False + 0 + False - False + True + end 0 - + True - 7 - 5 - - - True - 3 - 6 - True - - - True - True - automatic - automatic - etched-in - - - True - True - liststore1 - False - False - 0 - - - - dataitems - - - - 0 - - - - - - - - - 2 - 3 - - - - - True - True - automatic - automatic - etched-in - - - True - True - immediate - word-char - 6 - 6 - textbuffer1 - - - - - 2 - - - - - 0 - - + False + label13 + True + center + + + False + True + 1 + + + + + + button13 + + + + False + 5 + Wakeup Introduction + center-on-parent + True + dialog + True + + + + True + False + 2 + + + True + False + end - - True - True - - - - True - - - True - True - automatic - automatic - etched-in - - - True - True - liststore5 - False - 0 - - - Text - True - - - 7 - - - 0 - - - - - - - Time - 0.5 - - - - 1 - - - - - - - Recurrence - 0.5 - - - - 2 - - - - - - - Boot - 0.5 - - - - 3 - - - - - - - - - 0 - - - - - True - vertical - icons - False - - - True - Add alarm - toolbutton1 - True - gtk-add - - - - False - True - - - - - True - Remove alarm - toolbutton2 - True - gtk-remove - - - - False - True - - - - - False - False - end - 1 - - - - - - - True - Edit multiple alarms... - - + + gtk-ok + True + True + True + False + True + + + + False + False + 0 + + + + + False + True + end + 0 + + + + + True + False + + + True + False + 0 + 0 + Welcome to Wakeup! Wakeup is a talking alarm clock which will set your computer to wake itself up - from shutdown if your bios allows. +The alarm is spoken from the text in the text box on the left. A list of available data items, which allow the alarm to tell you useful information, is available from installed plugins in the list on the right. Simply type them into the alarm text or double click them. To set the alarm or plugin settings, click "Preferences." For more detailed instruction, click "Help." + +Note that for any part of the alarm which depends on information from the web to work when you are not logged in, you will need to set the wireless network(s) you connect to so that they connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." + fill + True + 54 + + + + False + True + 0 + + + + + Always show this message at startup + True + True + False + False + True + True False False + 4 1 + + + False + True + 1 + + + + + + button16 + + + + 450 + 400 + False + GDK_KEY_PRESS_MASK | GDK_STRUCTURE_MASK + Help + False + mouse + True + appointment-new + dialog + window + + + + + True + True + + + True + False + 6 - + True - 5 - True - start - - - gtk-preferences - True - True - True - True - - - - False - False - 0 - True - - - - - gtk-media-play - True - True - True - True - - - - False - False - 1 - True - - + True - - gtk-apply + True - True - True - True - + False + queue + adjustment6 + + + True + False + 10 + <b>Alarm Text</b> +In the main text window, simply type the text that you want to have spoken when the alarm runs. +<b>Hot Text</b> +Available hot-text items are listed in the list at the right in the main window. These can be inserted into the text by double-clicking on them or simply typing them into your alarm text. A blank line signifies a new paragraph. Each paragraph's hot-text items are updated immediately before the text is spoken, so if you want the $time, for instance, to reflect the current time somewhere in the middle of your text, leave a blank line before the sentence in which it occurs. +<b>Note</b> that for hot-text items dependent on data from the web to work when not logged in (see Computer Wakeup below), you need to set the wireless network(s) you connect to so that they also connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." +<b>Plugins</b> +Available plugins are listed in the "Plugins" tab under "Preferences." Each plugin adds hot-text items to the list in the main window. A plugin's hot-text items are only interpreted if the plugin is active. +<b>Alarm Settings</b> +The alarm time and recurrence settings can be set under the "General" tab of "Preferences." The volume of the alarm and preferences for all hot-text items can be set as well. +<b>Computer Wakeup</b> +In the general preferences, there is a default option to wake the computer for alarms. With this checked, your computer will be set to wake up - from shutdown if your computer allows - five minutes prior to the set alarm time. The alarm will run even if you are not logged in. Note that this option requires administrative (root) permission. +<b>Multiple Alarms</b> +Each alarm's settings are completely independent. Click "Edit multiple alarms..." to create and delete alarms. + True + fill + True + + - - False - False - 2 - True - + + + True + True + 0 + + + + + True + False - - gtk-close + + gtk-ok True True True + False True - + False False - 3 - True + 3 + end + 0 + + + False + False + 3 + 1 + + + + + + + True + False + Usage + + + False + + + + + True + False + + + True + False + 1 + 1 + <big><big><big><b>Wakeup 1.2</b></big></big></big> + +Copyright (c) David Glass 2012 +&lt;dsglass@gmail.com&gt; + +Copyright is GPLv3 or later +(/usr/share/common-licenses/GPL-3) + True + center + + + True + True + 0 + + + + + True + False - - gtk-help + + gtk-ok True True True + False True - + False False - 4 + 3 + end + 0 False False - end - 2 + 3 + 1 @@ -504,19 +362,92 @@ 1 + + + True + False + About + + + 1 + False + + + + + + + + + + + + + + + + + + + + + + + + + + Minute + + + Hour + + + Day + + + Week + + + Month + + + + + + + + + + + + + + + + + + + + + + + + + + False 5 - Plugins + Preferences mouse 500 300 appointment-new dialog - - + + True @@ -524,29 +455,36 @@ True + False 5 True + False 8 True + False True + False 0.059999998658895493 True + False 12 True + False 6 True + False Time: @@ -573,6 +511,7 @@ True + False : @@ -603,6 +542,7 @@ True + False 0 0 6 @@ -614,34 +554,40 @@ False + True 0 True + False 0.070000000298023224 True + False 12 True False + False True True + False Every: True True False + False True True - + False @@ -652,9 +598,10 @@ True + False liststore3 1 - + @@ -672,6 +619,7 @@ True False + False Day of month: @@ -685,7 +633,7 @@ True False True - + adjustment4 @@ -696,12 +644,15 @@ + True + True 0 True + False Sun @@ -709,9 +660,12 @@ False True False + False True + True + True 0 @@ -722,9 +676,12 @@ False True False + False True + True + True 1 @@ -735,9 +692,12 @@ False True False + False True + True + True 2 @@ -748,9 +708,12 @@ False True False + False True + True + True 3 @@ -761,9 +724,12 @@ False True False + False True + True + True 4 @@ -774,9 +740,12 @@ False True False + False True + True + True 5 @@ -787,32 +756,41 @@ False True False + False True + True + True 6 + True + True 1 True + False Cron format (m h dom mon dow): True True False + False True True radiobutton1 - + + True + True 0 @@ -821,15 +799,19 @@ True False True - + + True + True 3 1 + True + True 2 @@ -843,17 +825,22 @@ True True False + False True - + + True + True 1 + True + True 3 0 @@ -861,9 +848,11 @@ True + False True + False 3 Volume center @@ -883,78 +872,64 @@ 0 + True + True 1 False + True 6 1 + True + True 0 - - True - - - Set computer to wake up for alarm (requires root permission) - True - True - False - True - True - - - 10 - 0 - - - - - 2 - - - True + False 6 - - gtk-ok + + gtk-cancel True True True + False True - + False False + 4 end - 1 + 0 - - gtk-cancel + + gtk-ok True True True + False True - + False False - 4 end - 0 + 1 @@ -966,11 +941,40 @@ 1 + + + True + False + + + Set computer to wake up for alarm (requires root permission) + True + True + False + False + True + True + + + True + True + 10 + 0 + + + + + True + True + 2 + + True + False General @@ -980,12 +984,15 @@ True + False True + False True + False 0 9 5 @@ -1001,8 +1008,6 @@ True True - automatic - automatic etched-in @@ -1012,6 +1017,9 @@ False False 0 + + + fixed @@ -1029,7 +1037,7 @@ column - + 1 @@ -1053,20 +1061,24 @@ + True + True 1 True + False Use other speech tool: True True False + False True - + False @@ -1080,9 +1092,11 @@ True False True - + + True + True 5 1 @@ -1097,37 +1111,219 @@ - 0 + True + True + 0 + + + + + True + False + 6 + + + gtk-cancel + True + True + True + False + True + + + + False + False + 4 + end + 0 + + + + + More Voices... + True + True + True + False + none + http://ubuntuforums.org/showthread.php?t=751169 + + + False + False + end + 1 + + + + + gtk-ok + True + True + True + False + True + + + + False + False + end + 2 + + + + + False + False + 6 + end + 1 + + + + + 1 + + + + + True + False + Voices + + + 1 + False + + + + + True + False + 4 + + + True + False + + + True + False + 9 + 5 + Available Plugins: + + + False + True + 0 + + + + + False + False + 0 + + + + + True + True + etched-in + + + True + True + liststore2 + False + 0 + + + + + + + Active + 1 + + + + + + 2 + + + + + + + Plugin + True + + + + 0 + + + + + + + Description + True + + + + 1 + + + + + + + + + True + True + 1 - + True + False 6 - - gtk-ok + + gtk-cancel True True True + False True - + False False + 4 end - 2 + 0 - - More Voices... + + gtk-preferences True + False True True - none - http://ubuntuforums.org/showthread.php?t=751169 + False + True + False @@ -1137,20 +1333,20 @@ - - gtk-cancel + + gtk-ok True True True + False True - + False False - 4 end - 0 + 2 @@ -1159,554 +1355,543 @@ False 6 end - 1 + 2 - 1 + 2 - + True - Voices + False + Plugins - 1 + 2 False + True + + + + + Type your alarm text here, inserting hot text items from the list at the right as desired. For example: + +Good morning. Today is $date. The time is $time. It is $temperature degrees outside with $skyconditions skies, and winds $windconditions. Expect $todays_forecast, with a high of $high and low of $low. + +Be sure to modify individual plug-in preferences under the "plugins" tab in the Preferences window. This allows you to specify which mp3 file you will hear from the music item, whether to present weather in Farenheit or Celsius, and so on. + +Note that hot text items are loaded at the beginning of each paragraph (a new paragraph is specified by leaving one or more blank lines). Hence the time is now $time, whereas in the previous paragraph it might have been a minute earlier. + + + Alarm Text +In the main text window, simply type the text that you want to have spoken when the alarm runs. +Hot Text +Available hot-text items are listed in the list at the right in the main window. These can be inserted into the text by double-clicking on them or simply typing them into your alarm text. A blank line signifies a new paragraph. Each paragraph's hot-text items are updated immediately before the text is spoken, so if you want the $time, for instance, to reflect the current time somewhere in the middle of your text, leave a blank line before the sentence in which it occurs. +Note that for hot-text items dependent on data from the web to work when not logged in (see Computer Wakeup below), you need to set the wireless network(s) you connect to so that they also connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." +Plugins +Available plugins are listed in the "Plugins" tab under "Preferences." Each plugin adds hot-text items to the list in the main window. A plugin's hot-text items are only interpreted if the plugin is active. +Alarm Settings +The alarm time and recurrence settings can be set under the "General" tab of "Preferences." The volume of the alarm and preferences for all hot-text items can be set as well. +Computer Wakeup +In the general preferences, there is a default option to wake the computer for alarms. With this checked, your computer will be set to wake up - from shutdown if your computer allows - five minutes prior to the set alarm time. The alarm will run even if you are not logged in. Note that this option requires administrative (root) permission. + + + True + False + Wakeup Settings Configuration + center + 605 + 440 + appointment-new + + + + True + False - + True - 4 + False - + + True + False + False + _File + True + + + True + False + + + gtk-new + True + False + False + True + True + + + + + + gtk-apply + True + False + False + True + True + + + + + + True + False + + + + + gtk-quit + True + False + False + True + True + + + + + + + + + + True + False + False + _Edit + True + + + True + False + + + gtk-preferences + True + False + False + True + True + + + + + + gtk-media-play + True + False + False + True + True + + + + + + gtk-remove + True + False + False + True + True + + + + + + + + + + True + False + False + _Help + True + + + True + False + + + True + False + False + _Usage + True + + + + + + gtk-about + True + False + False + True + True + + + + + + + + + + False + False + 0 + + + + + True + False + 7 + 5 + + True + False + 3 + 6 + True - + True - 9 - 5 - Available Plugins: + True + etched-in + + + True + True + liststore1 + False + False + 0 + + + + + + + dataitems + + + + 0 + + + + + + - False - 0 + 2 + 3 + + + + + True + True + etched-in + + + True + True + immediate + word-char + 6 + 6 + textbuffer1 + + + + + 2 - False - False + True + True 0 - + True True - automatic - automatic - etched-in + - + True - True - liststore2 - False - 0 - + False - - Active - 1 + + True + True + etched-in - - + + True + True + liststore5 + False + 0 + + + + + + Text + True + + + 7 + + + 0 + + + + + + + Time + 0.5 + + + + 1 + + + + + + + Recurrence + 0.5 + + + + 2 + + + + + + + Boot + 0.5 + + + + 3 + + + + - - 2 - + + True + True + 0 + - - Plugin - True + + True + False + vertical + icons + False - - - 0 - + + True + False + Add alarm + False + toolbutton1 + True + gtk-add + + + + False + True + - - - - - Description - True - - - 1 - + + True + False + Remove alarm + False + toolbutton2 + True + gtk-remove + + + + False + True + + + False + False + end + 1 + + + + True + False + Edit multiple alarms... + + + False + False 1 - + True - 6 + False + 5 + True + start - - gtk-ok + + gtk-preferences True True True + False True - + False False - end - 2 + 1 + True - - gtk-preferences + + gtk-media-play True - False True True + False True - + False False - end - 1 + 3 + True - - gtk-cancel + + gtk-help True True True + False True - + False False - 4 - end - 0 + 4 - - - False - False - 6 - end - 2 - - - - - 2 - - - - - True - Plugins - - - 2 - False - True - - - - - - - 450 - 400 - GDK_KEY_PRESS_MASK | GDK_STRUCTURE_MASK - Help - False - mouse - True - appointment-new - dialog - window - - - - - True - True - - - True - 6 - - - True - True - automatic - automatic - - - True - queue - adjustment6 - - - True - 10 - <b>Alarm Text</b> -In the main text window, simply type the text that you want to have spoken when the alarm runs. -<b>Hot Text</b> -Available hot-text items are listed in the list at the right in the main window. These can be inserted into the text by double-clicking on them or simply typing them into your alarm text. A blank line signifies a new paragraph. Each paragraph's hot-text items are updated immediately before the text is spoken, so if you want the $time, for instance, to reflect the current time somewhere in the middle of your text, leave a blank line before the sentence in which it occurs. -<b>Note</b> that for hot-text items dependent on data from the web to work when not logged in (see Computer Wakeup below), you need to set the wireless network(s) you connect to so that they also connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." -<b>Plugins</b> -Available plugins are listed in the "Plugins" tab under "Preferences." Each plugin adds hot-text items to the list in the main window. A plugin's hot-text items are only interpreted if the plugin is active. -<b>Alarm Settings</b> -The alarm time and recurrence settings can be set under the "General" tab of "Preferences." The volume of the alarm and preferences for all hot-text items can be set as well. -<b>Computer Wakeup</b> -In the general preferences, there is a default option to wake the computer for alarms. With this checked, your computer will be set to wake up - from shutdown if your computer allows - five minutes prior to the set alarm time. The alarm will run even if you are not logged in. Note that this option requires administrative (root) permission. -<b>Multiple Alarms</b> -Each alarm's settings are completely independent. Click "Edit multiple alarms..." to create and delete alarms. - True - fill - True - - - - - - - 0 - - - - - True - - - gtk-ok + + + gtk-apply True True True + False True - + False False - 3 - end - 0 + 4 + True - - - False - False - 3 - 1 - - - - - - - True - Usage - - - False - - - - - True - - - True - 1 - 1 - <big><big><big><b>Wakeup 1.1</b></big></big></big> - -Copyright (c) David Glass 2011 -&lt;dsglass@gmail.com&gt; - -Copyright is GPLv3 or later -(/usr/share/common-licenses/GPL-3) - True - center - - - 0 - - - - - True - - gtk-ok + + gtk-close True True True + False True - + False False - 3 - end - 0 + 5 + True False False - 3 - 1 - - - - - 1 - - - - - True - About - - - 1 - False - - - - - - - Type your alarm text here, inserting hot text items from the list at the right as desired. For example: - -Good morning. Today is $date. The time is $time. It is $temperature outside with $skyconditions skies, $weatherconditions, and winds $windconditions. - -Note that hot text items are loaded at the beginning of each paragraph (a new paragraph is specified by leaving one or more blank lines). Hence the time is now $time, whereas in the previous paragraph it might have been a minute earlier. - - - 110 - 5 - 10 - 10 - - - 1 - 1 - 31 - 1 - 10 - - - 30 - 59 - 1 - 10 - - - 8 - 23 - 1 - 5 - - - 5 - Wakeup - True - center-on-parent - dialog - True - False - - - - True - immediate - 2 - - - True - label13 - True - center - - - 1 - - - - - True - center - - - gtk-ok - True - True - True - True - - - - False - False - 0 - - - - - False - end - 0 - - - - - - button13 - - - - 5 - Wakeup Introduction - center-on-parent - True - dialog - True - False - - - - True - 2 - - - True - - - True - 0 - 0 - Welcome to Wakeup! Wakeup is a talking alarm clock which will set your computer to wake itself up - from shutdown if your bios allows. -The alarm is spoken from the text in the text box on the left. A list of available data items, which allow the alarm to tell you useful information, is available from installed plugins in the list on the right. Simply type them into the alarm text or double click them. To set the alarm or plugin settings, click "Preferences." For more detailed instruction, click "Help." - -Note that for any part of the alarm which depends on information from the web to work when you are not logged in, you will need to set the wireless network(s) you connect to so that they connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." - fill - True - 54 - - - - False - 0 - - - - - Always show this message at startup - True - True - False - True - True - - - False - False - 4 - 1 + end + 2 + True + True 1 - - - True - end - - - gtk-ok - True - True - True - True - - - - False - False - 0 - - - - - False - end - 0 - - - - button16 - - - - Alarm Text -In the main text window, simply type the text that you want to have spoken when the alarm runs. -Hot Text -Available hot-text items are listed in the list at the right in the main window. These can be inserted into the text by double-clicking on them or simply typing them into your alarm text. A blank line signifies a new paragraph. Each paragraph's hot-text items are updated immediately before the text is spoken, so if you want the $time, for instance, to reflect the current time somewhere in the middle of your text, leave a blank line before the sentence in which it occurs. -Note that for hot-text items dependent on data from the web to work when not logged in (see Computer Wakeup below), you need to set the wireless network(s) you connect to so that they also connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." -Plugins -Available plugins are listed in the "Plugins" tab under "Preferences." Each plugin adds hot-text items to the list in the main window. A plugin's hot-text items are only interpreted if the plugin is active. -Alarm Settings -The alarm time and recurrence settings can be set under the "General" tab of "Preferences." The volume of the alarm and preferences for all hot-text items can be set as well. -Computer Wakeup -In the general preferences, there is a default option to wake the computer for alarms. With this checked, your computer will be set to wake up - from shutdown if your computer allows - five minutes prior to the set alarm time. The alarm will run even if you are not logged in. Note that this option requires administrative (root) permission. - - - 100 - 1 - 10 - 10 diff -Nru wakeup-1.1/data/wakeup/wakeup.glade~ wakeup-1.2/data/wakeup/wakeup.glade~ --- wakeup-1.1/data/wakeup/wakeup.glade~ 2011-09-23 10:16:06.000000000 -0700 +++ wakeup-1.2/data/wakeup/wakeup.glade~ 1969-12-31 16:00:00.000000000 -0800 @@ -1,1712 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - Minute - - - Hour - - - Day - - - Week - - - Month - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Wakeup Settings Configuration - center - 605 - 440 - appointment-new - - - - True - - - True - - - True - _File - True - - - True - - - gtk-new - True - True - True - - - - - - gtk-apply - True - True - True - - - - - - True - - - - - gtk-quit - True - True - True - - - - - - - - - - True - _Edit - True - - - True - - - gtk-preferences - True - True - True - - - - - - gtk-media-play - True - True - True - - - - - - gtk-remove - True - True - True - - - - - - - - - - True - _Help - True - - - True - - - True - _Usage - True - - - - - - gtk-about - True - True - True - - - - - - - - - - False - False - 0 - - - - - True - 7 - 5 - - - True - 3 - 6 - True - - - True - True - automatic - automatic - etched-in - - - True - True - liststore1 - False - False - 0 - - - - dataitems - - - - 0 - - - - - - - - - 2 - 3 - - - - - True - True - automatic - automatic - etched-in - - - True - True - immediate - word-char - 6 - 6 - textbuffer1 - - - - - 2 - - - - - 0 - - - - - True - True - - - - True - - - True - True - automatic - automatic - etched-in - - - True - True - liststore5 - False - 0 - - - Text - True - - - 7 - - - 0 - - - - - - - Time - 0.5 - - - - 1 - - - - - - - Recurrence - 0.5 - - - - 2 - - - - - - - Boot - 0.5 - - - - 3 - - - - - - - - - 0 - - - - - True - vertical - icons - False - - - True - Add alarm - toolbutton1 - True - gtk-add - - - - False - True - - - - - True - Remove alarm - toolbutton2 - True - gtk-remove - - - - False - True - - - - - False - False - end - 1 - - - - - - - True - Edit multiple alarms... - - - - - False - False - 1 - - - - - True - 5 - True - start - - - gtk-preferences - True - True - True - True - - - - False - False - 0 - True - - - - - gtk-media-play - True - True - True - True - - - - False - False - 1 - True - - - - - gtk-apply - True - True - True - True - - - - False - False - 2 - True - - - - - gtk-close - True - True - True - True - - - - False - False - 3 - True - - - - - gtk-help - True - True - True - True - - - - False - False - 4 - - - - - False - False - end - 2 - - - - - 1 - - - - - - - 5 - Plugins - mouse - 500 - 300 - appointment-new - dialog - - - - - True - True - - - True - 5 - - - True - 8 - - - True - - - True - 0.059999998658895493 - - - True - 12 - - - True - 6 - - - True - Time: - - - False - False - 0 - - - - - True - True - 2 - 0 - adjustment2 - 1 - - - False - False - 1 - - - - - True - : - - - False - False - 2 - - - - - True - True - 2 - 0 - adjustment3 - 1 - - - False - False - 3 - - - - - - - - - True - 0 - 0 - 6 - 6 - Alarm time - True - - - - - False - 0 - - - - - True - 0.070000000298023224 - - - True - 12 - - - True - False - True - - - True - - - Every: - True - True - False - True - True - - - - False - False - 0 - - - - - True - liststore3 - 1 - - - - - 0 - - - - - False - False - 1 - - - - - True - False - Day of month: - - - False - False - 2 - - - - - True - False - True - - adjustment4 - - - False - False - 3 - - - - - 0 - - - - - True - - - Sun - True - False - True - False - True - - - 0 - - - - - Mon - True - False - True - False - True - - - 1 - - - - - Tue - True - False - True - False - True - - - 2 - - - - - Wed - True - False - True - False - True - - - 3 - - - - - Thu - True - False - True - False - True - - - 4 - - - - - Fri - True - False - True - False - True - - - 5 - - - - - Sat - True - False - True - False - True - - - 6 - - - - - 1 - - - - - True - - - Cron format (m h dom mon dow): - True - True - False - True - True - radiobutton1 - - - - 0 - - - - - True - False - True - - - - 3 - 1 - - - - - 2 - - - - - - - - - Recurrs - True - True - False - True - - - - - - 1 - - - - - 3 - 0 - - - - - True - - - True - 3 - Volume - center - - - False - False - 0 - - - - - True - True - adjustment1 - True - 0 - - - 1 - - - - - False - 6 - 1 - - - - - 0 - - - - - True - - - Set computer to wake up for alarm (requires root permission) - True - True - False - True - True - - - 10 - 0 - - - - - 2 - - - - - True - 6 - - - gtk-ok - True - True - True - True - - - - False - False - end - 1 - - - - - gtk-cancel - True - True - True - True - - - - False - False - 4 - end - 0 - - - - - False - False - 6 - end - 1 - - - - - - - True - General - - - False - - - - - True - - - True - - - True - 0 - 9 - 5 - Choose voice (using festival speech tool): - - - False - False - 0 - - - - - True - True - automatic - automatic - etched-in - - - True - True - liststore4 - False - False - 0 - - - fixed - 1 - 0 - column - - - - - - - - 40 - column - - - - - - 1 - - - - - - - 400 - column - - - - 0 - - - - - - - - - 1 - - - - - True - - - Use other speech tool: - True - True - False - True - - - - False - False - 5 - 0 - - - - - True - False - True - - - - 5 - 1 - - - - - False - False - 4 - 2 - - - - - 0 - - - - - True - 6 - - - gtk-ok - True - True - True - True - - - - False - False - end - 2 - - - - - More Voices... - True - True - True - none - http://ubuntuforums.org/showthread.php?t=751169 - - - False - False - end - 1 - - - - - gtk-cancel - True - True - True - True - - - - False - False - 4 - end - 0 - - - - - False - False - 6 - end - 1 - - - - - 1 - - - - - True - Voices - - - 1 - False - - - - - True - 4 - - - True - - - True - 9 - 5 - Available Plugins: - - - False - 0 - - - - - False - False - 0 - - - - - True - True - automatic - automatic - etched-in - - - True - True - liststore2 - False - 0 - - - - Active - 1 - - - - - - 2 - - - - - - - Plugin - True - - - - 0 - - - - - - - Description - True - - - - 1 - - - - - - - - - 1 - - - - - True - 6 - - - gtk-ok - True - True - True - True - - - - False - False - end - 2 - - - - - gtk-preferences - True - False - True - True - True - - - - False - False - end - 1 - - - - - gtk-cancel - True - True - True - True - - - - False - False - 4 - end - 0 - - - - - False - False - 6 - end - 2 - - - - - 2 - - - - - True - Plugins - - - 2 - False - True - - - - - - - 450 - 400 - GDK_KEY_PRESS_MASK | GDK_STRUCTURE_MASK - Help - False - mouse - True - appointment-new - dialog - window - - - - - True - True - - - True - 6 - - - True - True - automatic - automatic - - - True - queue - adjustment6 - - - True - 10 - <b>Alarm Text</b> -In the main text window, simply type the text that you want to have spoken when the alarm runs. -<b>Hot Text</b> -Available hot-text items are listed in the list at the right in the main window. These can be inserted into the text by double-clicking on them or simply typing them into your alarm text. A blank line signifies a new paragraph. Each paragraph's hot-text items are updated immediately before the text is spoken, so if you want the $time, for instance, to reflect the current time somewhere in the middle of your text, leave a blank line before the sentence in which it occurs. -<b>Note</b> that for hot-text items dependent on data from the web to work when not logged in (see Computer Wakeup below), you need to set the wireless network(s) you connect to so that they also connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." -<b>Plugins</b> -Available plugins are listed in the "Plugins" tab under "Preferences." Each plugin adds hot-text items to the list in the main window. A plugin's hot-text items are only interpreted if the plugin is active. -<b>Alarm Settings</b> -The alarm time and recurrence settings can be set under the "General" tab of "Preferences." The volume of the alarm and preferences for all hot-text items can be set as well. -<b>Computer Wakeup</b> -In the general preferences, there is a default option to wake the computer for alarms. With this checked, your computer will be set to wake up - from shutdown if your computer allows - five minutes prior to the set alarm time. The alarm will run even if you are not logged in. Note that this option requires administrative (root) permission. -<b>Multiple Alarms</b> -Each alarm's settings are completely independent. Click "Edit multiple alarms..." to create and delete alarms. - True - fill - True - - - - - - - 0 - - - - - True - - - gtk-ok - True - True - True - True - - - - False - False - 3 - end - 0 - - - - - False - False - 3 - 1 - - - - - - - True - Usage - - - False - - - - - True - - - True - 1 - 1 - <big><big><big><b>Wakeup 1.0</b></big></big></big> - -Copyright (c) David Glass 2011 -&lt;dsglass@gmail.com&gt; - -Copyright is GPLv3 or later -(/usr/share/common-licenses/GPL-3) - True - center - - - 0 - - - - - True - - - gtk-ok - True - True - True - True - - - - False - False - 3 - end - 0 - - - - - False - False - 3 - 1 - - - - - 1 - - - - - True - About - - - 1 - False - - - - - - - Type your alarm text here, inserting hot text items from the list at the right as desired. For example: - -Good morning. Today is $date. The time is $time. It is $temperature outside with $skyconditions skies, $weatherconditions, and winds $windconditions. - -Note that hot text items are loaded at the beginning of each paragraph (a new paragraph is specified by leaving one or more blank lines). Hence the time is now $time, whereas in the previous paragraph it might have been a minute earlier. - - - 110 - 5 - 10 - 10 - - - 1 - 1 - 31 - 1 - 10 - - - 30 - 59 - 1 - 10 - - - 8 - 23 - 1 - 5 - - - 5 - Wakeup - True - center-on-parent - dialog - True - False - - - - True - immediate - 2 - - - True - label13 - True - center - - - 1 - - - - - True - center - - - gtk-ok - True - True - True - True - - - - False - False - 0 - - - - - False - end - 0 - - - - - - button13 - - - - 5 - Wakeup Introduction - center-on-parent - True - dialog - True - False - - - - True - 2 - - - True - - - True - 0 - 0 - Welcome to Wakeup! Wakeup is a talking alarm clock which will set your computer to wake itself up - from shutdown if your bios allows. -The alarm is spoken from the text in the text box on the left. A list of available data items, which allow the alarm to tell you useful information, is available from installed plugins in the list on the right. Simply type them into the alarm text or double click them. To set the alarm or plugin settings, click "Preferences." For more detailed instruction, click "Help." - -Note that for any part of the alarm which depends on information from the web to work when you are not logged in, you will need to set the wireless network(s) you connect to so that they connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." - fill - True - 54 - - - - False - 0 - - - - - Always show this message at startup - True - True - False - True - True - - - False - False - 4 - 1 - - - - - 1 - - - - - True - end - - - gtk-ok - True - True - True - True - - - - False - False - 0 - - - - - False - end - 0 - - - - - - button16 - - - - Alarm Text -In the main text window, simply type the text that you want to have spoken when the alarm runs. -Hot Text -Available hot-text items are listed in the list at the right in the main window. These can be inserted into the text by double-clicking on them or simply typing them into your alarm text. A blank line signifies a new paragraph. Each paragraph's hot-text items are updated immediately before the text is spoken, so if you want the $time, for instance, to reflect the current time somewhere in the middle of your text, leave a blank line before the sentence in which it occurs. -Note that for hot-text items dependent on data from the web to work when not logged in (see Computer Wakeup below), you need to set the wireless network(s) you connect to so that they also connect before you log in. This can be done through NetworkManager, by selecting a connection, clicking "Edit..." and checking "Available to all users." -Plugins -Available plugins are listed in the "Plugins" tab under "Preferences." Each plugin adds hot-text items to the list in the main window. A plugin's hot-text items are only interpreted if the plugin is active. -Alarm Settings -The alarm time and recurrence settings can be set under the "General" tab of "Preferences." The volume of the alarm and preferences for all hot-text items can be set as well. -Computer Wakeup -In the general preferences, there is a default option to wake the computer for alarms. With this checked, your computer will be set to wake up - from shutdown if your computer allows - five minutes prior to the set alarm time. The alarm will run even if you are not logged in. Note that this option requires administrative (root) permission. - - - 100 - 1 - 10 - 10 - - diff -Nru wakeup-1.1/data/wakeup/wakeupRootHelper wakeup-1.2/data/wakeup/wakeupRootHelper --- wakeup-1.1/data/wakeup/wakeupRootHelper 1969-12-31 16:00:00.000000000 -0800 +++ wakeup-1.2/data/wakeup/wakeupRootHelper 2012-02-07 10:21:14.000000000 -0800 @@ -0,0 +1,20 @@ +#!/bin/bash +# Helper program to allow elevated privaleges for wakeup-settings (and alarm.py) +# using pkexec without giving away privaleges to other scripts +# Copyright (C) 2012 David Glass +# Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 + +commands=(/usr/bin/setalarm /usr/bin/crontab /usr/share/wakeup/setnextalarm.py /usr/share/wakeup/createRootPlayfile.py) +allowed=false +for i in ${commands[@]}; do + if [[ $1 = $i ]]; then + allowed=true + fi +done +if [[ $allowed != true ]]; then + echo "$1: Elevated command not allowed." + exit 1 +else + eval $* +fi + diff -Nru wakeup-1.1/debian/changelog wakeup-1.2/debian/changelog --- wakeup-1.1/debian/changelog 2011-11-22 18:15:10.000000000 -0800 +++ wakeup-1.2/debian/changelog 2012-02-07 10:40:24.000000000 -0800 @@ -1,3 +1,26 @@ +wakeup (1.2-0ubuntu1) precise; urgency=low + + * New upstream release (LP: #909189). + - Moved from using gksudo to using pkexec. Added policy file. + - Changed weather source to google using python-pywapi + - Added location.py in wakeup directory as plugin helper + - Added plugin "Commands" which allows arbitrary user dataitems + - Changed HebrewCalendar to use location from location.py + - fixed problems to do with hard-coded DISPLAY variable + - fixed issues with stopping the alarm + - removed calls to os.system and commands.get(status)output + - use secure temp files (LP: #912762) + - root-owned chmod 700 playable_text file for boot alarms + - small bug fixes + * Updated packaging + - replaced gksu with python-dbus in debian/control + - Removed all perl dependencies + - wrap-and-sort debian/ + - converted copyright to dep5 format + - use dh_python2 instead of pysupport + + -- David Glass Tue, 07 Feb 2012 10:36:30 -0800 + wakeup (1.1-0ubuntu1) precise; urgency=low * New upstream release (LP: #876649). diff -Nru wakeup-1.1/debian/control wakeup-1.2/debian/control --- wakeup-1.1/debian/control 2011-05-23 06:50:56.000000000 -0700 +++ wakeup-1.2/debian/control 2012-02-07 10:39:28.000000000 -0800 @@ -3,13 +3,26 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: David Glass -Build-Depends: cdbs (>= 0.4.62), debhelper (>= 7), python (>=2.4), python-support +Build-Depends: cdbs (>= 0.4.90~), debhelper (>= 7), python (>=2.6.6-3~) Standards-Version: 3.9.2 Homepage: https://launchpad.net/wakeup Package: wakeup Architecture: all -Depends: ${misc:Depends}, ${python:Depends}, weather-util, python-evolution, python-dateutil, python-vobject, python-feedparser, python-glade2, festival, perl, curl, gksu, shell-fm, mpg123 +Depends: curl, + festival, + mpg123, + python-dateutil, + python-dbus, + python-evolution, + python-feedparser, + python-glade2, + python-pywapi, + python-vobject, + shell-fm, + weather-util, + ${misc:Depends}, + ${python:Depends} Suggests: hebcal Description: Fully customizable and extensible talking alarm clock This package has a complete graphical front end with which a user can set an diff -Nru wakeup-1.1/debian/copyright wakeup-1.2/debian/copyright --- wakeup-1.1/debian/copyright 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/debian/copyright 2012-01-10 01:50:07.000000000 -0800 @@ -1,36 +1,24 @@ -This work was created by: - - David Glass on Sun, 04 Jul 2011 15:34:46 -0400 - -Upstream Author(s): - - David Glass - -Copyright: - - - -License: - - This program, including all source files and - documentation, is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY 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 . - -On Debian systems, the complete text of the GNU General -Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -The Debian packaging is: - - Copyright (C) 2011 David Glass - -and is licensed under the GPL version 3, see above. +Format: http://dep.debian.net/deps/dep5/ +Upstream-Name: Wakeup +Upstream-Contact: David Glass +Source: https://launchpad.net/wakeup + +Files: * +Copyright: Copyright (C) 2012 David Glass +License: GPL-3+ + This program, including all source files and documentation, + is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 + of the License, or (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY 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 . + . + On Debian systems, the complete text of the GNU General Public + License version 3 can be found in `/usr/share/common-licenses/GPL-3'. diff -Nru wakeup-1.1/debian/pyversions wakeup-1.2/debian/pyversions --- wakeup-1.1/debian/pyversions 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/debian/pyversions 1969-12-31 16:00:00.000000000 -0800 @@ -1 +0,0 @@ -2.4- diff -Nru wakeup-1.1/debian/rules wakeup-1.2/debian/rules --- wakeup-1.1/debian/rules 2011-05-28 22:06:30.000000000 -0700 +++ wakeup-1.2/debian/rules 2012-01-03 13:45:18.000000000 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/make -f -DEB_PYTHON_SYSTEM=pysupport +export DEB_PYTHON2_MODULE_PACKAGES=wakeup include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk diff -Nru wakeup-1.1/doc/setalarm.1 wakeup-1.2/doc/setalarm.1 --- wakeup-1.1/doc/setalarm.1 2011-11-09 22:28:43.000000000 -0800 +++ wakeup-1.2/doc/setalarm.1 2012-02-07 10:25:28.000000000 -0800 @@ -1,4 +1,4 @@ -.TH setalarm 1 "Version 1.1" "Nov 2011" +.TH setalarm 1 "Version 1.2" "Feb 2012" .SH NAME setalarm \- sets the system to start and run a script at specified times. @@ -66,7 +66,7 @@ .SH "SEE ALSO" \fBwakeup\fR(1), \fBwakeup\-settings\fR(1), \fBcron\fR, \fBcrontab\fR .SH AUTHOR -The program and its documentation are copyrighted (c) 2011 by David Glass +The program and its documentation are copyrighted (C) 2012 by David Glass . All rights reserved. They are distributed under the terms of the GNU General Public License version 3 or later. diff -Nru wakeup-1.1/doc/setalarm.1~ wakeup-1.2/doc/setalarm.1~ --- wakeup-1.1/doc/setalarm.1~ 2011-05-18 15:02:08.000000000 -0700 +++ wakeup-1.2/doc/setalarm.1~ 1969-12-31 16:00:00.000000000 -0800 @@ -1,72 +0,0 @@ -.TH setalarm 1 "Version 1.0.0" "May 2011" -.SH NAME -setalarm -\- sets the system to start and run a script at specified times. -.SH SYNOPSIS -.B setalarm -[ \-p ] [ [h]h:mm ] [ \-o offset ] [ command ] - -.B setalarm -[ \-p ] [ \-c m h dom mon dow ] [ \-o offset ] [ command ] - -.B setalarm -[ \-p ] [ \-u utc ] [ \-o offset ] [ command ] - -.B setalarm -\-d -.SH DESCRIPTION -This should be run as root, unless using the -.B \-p -option. The time to wake the computer can be given in three possible formats. -The simplest is just a time, written hh:mm or h:mm. This time is -interpreted as the earliest time in the future when that time occurs. -If the -.B \-c -option is provided, a cron\-formatted recurrence (minute hour day_of_month month -day_of_week) may follow. Special times such as "@hourly" are not accepted. -With the -.B \-u -option, the time to wake the computer should be provided in UTC format. -.P -.B command -is run at the closest time in the future that matches the recurrence rules or at -the time specified using an exact hh:mm or UTC time. For this to occur, the -computer is woken up several minutes in advance to allow for boot time. By -default, this "offset" is 5 minutes, but can be changed with the -.B \-o -option, in which case the computer is woken up -.B offset -minutes in advance. To ensure that the computer will wake given the -.B \-c -option, crontab entries are made in root's crontab to rerun -.B setalarm -as necessary. -.P -With the -.B \-p -option, -.B setalarm -will not make any changes to the system wake time or to root's crontab. Instead, -.B -setalarm -just prints the time, in UTC, at which the computer would be set to wake up with -the given input. -.P -Given the -.B \-d -option, -.B setalarm -removes all alarms. -.SH "NOTES" -.B setalarm -was created for use with -\fBwakeup\fR, a fully customizable and extensible talking alarm clock. However, it is -generally usable as a convenient wrapper for setting the system wakeup (see -http://www.mythtv.org/wiki/ACPI_Wakeup for details about ACPI wakeup) -.SH "SEE ALSO" -\fBwakeup\fR(1), \fBwakeup\-settings\fR(1), \fBcron\fR, \fBcrontab\fR -.SH AUTHOR -The program and its documentation are copyrighted (c) 2011 by David Glass -. All rights reserved. They are distributed under the terms -of the GNU General Public License version 3 or later. - diff -Nru wakeup-1.1/doc/wakeup.1 wakeup-1.2/doc/wakeup.1 --- wakeup-1.1/doc/wakeup.1 2011-11-09 22:28:49.000000000 -0800 +++ wakeup-1.2/doc/wakeup.1 2012-02-07 10:25:36.000000000 -0800 @@ -1,4 +1,4 @@ -.TH wakeup 1 "Version 1.1" "Nov 2011" +.TH wakeup 1 "Version 1.2" "Feb 2012" .SH NAME wakeup \- A talking and fully customizable alarm clock @@ -36,7 +36,7 @@ .SH "SEE ALSO" \fBsetalarm\fR(1), \fBwakeup\-settings\fR(1), \fBcron\fR, \fBcrontab\fR .SH AUTHOR -The program and its documentation are copyrighted (c) 2011 by David Glass +The program and its documentation are copyrighted (C) 2012 by David Glass . All rights reserved. They are distributed under the terms of the GNU General Public License version 3 or later. diff -Nru wakeup-1.1/doc/wakeup.1~ wakeup-1.2/doc/wakeup.1~ --- wakeup-1.1/doc/wakeup.1~ 2011-05-24 12:25:37.000000000 -0700 +++ wakeup-1.2/doc/wakeup.1~ 1969-12-31 16:00:00.000000000 -0800 @@ -1,42 +0,0 @@ -.TH wakeup 1 "Version 1.0.0" "May 2011" -.SH NAME -wakeup -\- A talking and fully customizable alarm clock -.SH SYNOPSIS -.B wakeup -username alarmID -.SH DESCRIPTION -.B wakeup -plays an alarm for the given username, whose settings for the alarm can be -modified using the -.B wakeup\-settings -utility. The user's alarm that is run is specified by alarmID, which corresponds -to the folder number in the user's wakeup settings folder ~/.wakeup. Alarm text -and all associated options should be defined by running -.B wakeup\-settings -as -\fBusername\fR. Although it is possible to modify the settings directly by -editing the files in ~/.wakeup/, this is not recommended and make cause you to -lose alarm settings. -.P -An option in -.B wakeup\-settings -allows the alarm to wake the computer (from poweroff if the bios -allows). In this case, -.B wakeup -is set by -to run from root's cron, and the alarm will run in this case even if no user is -logged in. One must log in or be logged in to stop the alarm. -.P -Note that for any part of the alarm which depends on information from the web to -work when you are not logged in, you will need to set the wireless network(s) -you connect to so that they connect before you log in. This can be done through -NetworkManager, by selecting a connection, clicking "Edit..." and checking -"Available to all users." -.SH "SEE ALSO" -\fBsetalarm\fR(1), \fBwakeup\-settings\fR(1), \fBcron\fR, \fBcrontab\fR -.SH AUTHOR -The program and its documentation are copyrighted (c) 2011 by David Glass -. All rights reserved. They are distributed under the terms -of the GNU General Public License version 3 or later. - diff -Nru wakeup-1.1/doc/wakeup-settings.1 wakeup-1.2/doc/wakeup-settings.1 --- wakeup-1.1/doc/wakeup-settings.1 2011-11-09 22:28:57.000000000 -0800 +++ wakeup-1.2/doc/wakeup-settings.1 2012-02-07 10:25:43.000000000 -0800 @@ -1,4 +1,4 @@ -.TH wakeup\-settings 1 "Version 1.1" "Nov 2011" +.TH wakeup\-settings 1 "Version 1.2" "Feb 2012" .SH NAME wakeup\-settings \- GUI frontend to configure \fBwakeup\fR, a talking and fully customizable @@ -26,7 +26,7 @@ .SH "SEE ALSO" \fBsetalarm\fR(1), \fBwakeup\fR(1), \fBcron\fR, \fBcrontab\fR .SH AUTHOR -The program and its documentation are copyrighted (c) 2011 by David Glass +The program and its documentation are copyrighted (C) 2012 by David Glass . All rights reserved. They are distributed under the terms of the GNU General Public License version 3 or later. diff -Nru wakeup-1.1/doc/wakeup-settings.1~ wakeup-1.2/doc/wakeup-settings.1~ --- wakeup-1.1/doc/wakeup-settings.1~ 2011-05-18 15:02:01.000000000 -0700 +++ wakeup-1.2/doc/wakeup-settings.1~ 1969-12-31 16:00:00.000000000 -0800 @@ -1,32 +0,0 @@ -.TH wakeup\-settings 1 "Version 1.0.0" "May 2011" -.SH NAME -wakeup\-settings -\- GUI frontend to configure \fBwakeup\fR, a talking and fully customizable -alarm clock -.SH SYNOPSIS -.B wakeup\-settings -.SH DESCRIPTION -This runs a graphical setting in which to edit the alarms run by -.B wakeup. -The time, volume, plugin settings, etc. for all alarms can be set through this -GUI. Given the "set computer to wake up for alarm" option, -.B wakeup -is set by -.B wakeup\-settings -to run from root's cron, and the alarms will run in this case even if no user is -logged in. One must log in or be logged in to stop the alarm. -Settings only pertain to the user who is running -.B wakeup\-settings. -.P -Note that for any part of the alarm which depends on information from the web to -work when you are not logged in, you will need to set the wireless network(s) -you connect to so that they connect before you log in. This can be done through -NetworkManager, by selecting a connection, clicking "Edit..." and checking -"Available to all users." -.SH "SEE ALSO" -\fBsetalarm\fR(1), \fBwakeup\fR(1), \fBcron\fR, \fBcrontab\fR -.SH AUTHOR -The program and its documentation are copyrighted (c) 2011 by David Glass -. All rights reserved. They are distributed under the terms -of the GNU General Public License version 3 or later. - diff -Nru wakeup-1.1/setup.py wakeup-1.2/setup.py --- wakeup-1.1/setup.py 2011-05-18 15:00:26.000000000 -0700 +++ wakeup-1.2/setup.py 2012-02-07 10:35:17.000000000 -0800 @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (C) 2011 David Glass +# Copyright (C) 2012 David Glass # Copyright is GPLv3 or later, see /usr/share/common-licenses/GPL-3 from distutils.core import setup @@ -9,7 +9,8 @@ ('share/applications', ['data/wakeup.desktop']), ('share/man/man1', ['doc/wakeup.1']), ('share/man/man1', ['doc/setalarm.1']), - ('share/man/man1', ['doc/wakeup-settings.1']) + ('share/man/man1', ['doc/wakeup-settings.1']), + ('share/polkit-1/actions', ['data/com.ubuntu.wakeup.policy']) ] for root, dirs, files in os.walk('data/wakeup'): for f in files: @@ -20,7 +21,7 @@ setup(name='wakeup', - version='1.0.0', + version='1.2', description='Fully customizable and extensible talking alarm clock', author='David Glass', author_email='dsglass@gmail.com',