diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26b2b58 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Privacy # +################## +hu-notes.txt + +# Basic OS Stuff # +################## +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db \ No newline at end of file diff --git a/hu-notes.txt b/hu-notes.txt deleted file mode 100644 index a777a08..0000000 --- a/hu-notes.txt +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hu.py b/hu.py index f422a94..26346fa 100644 --- a/hu.py +++ b/hu.py @@ -1,6 +1,6 @@ import datetime import time -import os +import os, sys, inspect class hu: @@ -17,12 +17,14 @@ def __init__(self): this is the part where i find out all of the things you want me to record. """ - + #cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0])) + #if cmd_folder not in sys.path: + # sys.path.insert(0, cmd_folder) # get names of all folders in the current directory that start with "hu_" - for file in os.listdir("."): + for file in os.listdir("./plugins/"): if file[0:3] == "hu_": - exec "import " + file + "." + file - exec "self.plugin_modules.append(" + file + "." + file + ")" + exec "import plugins." + file + "." + file + exec "self.plugin_modules.append(plugins." + file + "." + file + ")" def takeSnapshot(self): """ diff --git a/hu_currentlyplaying/__init__.pyc b/hu_currentlyplaying/__init__.pyc deleted file mode 100644 index f753a05..0000000 Binary files a/hu_currentlyplaying/__init__.pyc and /dev/null differ diff --git a/hu_currentlyplaying/hu_currentlyplaying.pyc b/hu_currentlyplaying/hu_currentlyplaying.pyc deleted file mode 100644 index 86e305c..0000000 Binary files a/hu_currentlyplaying/hu_currentlyplaying.pyc and /dev/null differ diff --git a/hu_googleweather/__init__.pyc b/hu_googleweather/__init__.pyc deleted file mode 100644 index 2fa9f07..0000000 Binary files a/hu_googleweather/__init__.pyc and /dev/null differ diff --git a/hu_googleweather/hu_googleweather.pyc b/hu_googleweather/hu_googleweather.pyc deleted file mode 100644 index 84979ac..0000000 Binary files a/hu_googleweather/hu_googleweather.pyc and /dev/null differ diff --git a/hu_lastfm/__init__.pyc b/hu_lastfm/__init__.pyc deleted file mode 100644 index 4bc156e..0000000 Binary files a/hu_lastfm/__init__.pyc and /dev/null differ diff --git a/hu_lastfm/pylast.pyc b/hu_lastfm/pylast.pyc deleted file mode 100644 index 511d4aa..0000000 Binary files a/hu_lastfm/pylast.pyc and /dev/null differ diff --git a/hu_openapps/__init__.pyc b/hu_openapps/__init__.pyc deleted file mode 100644 index fdd05d9..0000000 Binary files a/hu_openapps/__init__.pyc and /dev/null differ diff --git a/hu_openbrowsertabs/__init__.pyc b/hu_openbrowsertabs/__init__.pyc deleted file mode 100644 index 8e6ce95..0000000 Binary files a/hu_openbrowsertabs/__init__.pyc and /dev/null differ diff --git a/hu_openbrowsertabs/hu_openbrowsertabs.pyc b/hu_openbrowsertabs/hu_openbrowsertabs.pyc deleted file mode 100644 index e99b8de..0000000 Binary files a/hu_openbrowsertabs/hu_openbrowsertabs.pyc and /dev/null differ diff --git a/hu_openbrowsertabs/urls.applescript b/hu_openbrowsertabs/urls.applescript deleted file mode 100644 index 67ba051..0000000 --- a/hu_openbrowsertabs/urls.applescript +++ /dev/null @@ -1,15 +0,0 @@ -set urls to "" -tell application "Safari" - set window_list to windows - repeat with w in window_list - try - set tab_list to tabs of w - repeat with t in tab_list - set urls to urls & "\n" - end repeat - on error - -- not all windows have tabs - end try - end repeat -get urls -end tell \ No newline at end of file diff --git a/hu_ssidname/__init__.pyc b/hu_ssidname/__init__.pyc deleted file mode 100644 index fda899f..0000000 Binary files a/hu_ssidname/__init__.pyc and /dev/null differ diff --git a/plugins/__init__.py b/plugins/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/plugins/__init__.pyc b/plugins/__init__.pyc new file mode 100644 index 0000000..7a8be4e Binary files /dev/null and b/plugins/__init__.pyc differ diff --git a/plugins/hu_batterypower/__init__.py b/plugins/hu_batterypower/__init__.py new file mode 100644 index 0000000..0c4ee09 --- /dev/null +++ b/plugins/hu_batterypower/__init__.py @@ -0,0 +1 @@ +import hu_batterypower \ No newline at end of file diff --git a/plugins/hu_batterypower/__init__.pyc b/plugins/hu_batterypower/__init__.pyc new file mode 100644 index 0000000..042bc37 Binary files /dev/null and b/plugins/hu_batterypower/__init__.pyc differ diff --git a/plugins/hu_batterypower/hu_batterypower.py b/plugins/hu_batterypower/hu_batterypower.py new file mode 100644 index 0000000..313a618 --- /dev/null +++ b/plugins/hu_batterypower/hu_batterypower.py @@ -0,0 +1,56 @@ +import commands + +def getData(): + """ + uses the pmset command to find battery information + """ + powerInfo = commands.getoutput("pmset -g ps") + + ouputString = "" + powerState = "" + powerSource = "" + powerState = "" + percentage = "" + time = "" + + if "AC Power" in powerInfo: + powerSource = "AC" + elif "Battery" in powerInfo: + powerSource = "Battery" + if "charged" in powerInfo: + powerState = "Charged" + else: + if "discharging" in powerInfo: + powerState = "Discharging" + else: + powerState = "Charging" + if powerState != "": + percentOffset = powerInfo.find("%") + percentage = powerInfo[percentOffset-2:percentOffset] + if percentage[0] == " ": + percentage = percentage[1:] + timeOffset = powerInfo.find(":") + if timeOffset >= 0: + time = powerInfo[timeOffset-2:timeOffset+3] + if time[0] == " ": + time = time[1:] + if powerState != "": + outputString = "" + return outputString + + + + + + + + + + diff --git a/plugins/hu_batterypower/hu_batterypower.pyc b/plugins/hu_batterypower/hu_batterypower.pyc new file mode 100644 index 0000000..aff43a0 Binary files /dev/null and b/plugins/hu_batterypower/hu_batterypower.pyc differ diff --git a/hu_currentlyplaying/__init__.py b/plugins/hu_currentlyplaying/__init__.py similarity index 100% rename from hu_currentlyplaying/__init__.py rename to plugins/hu_currentlyplaying/__init__.py diff --git a/plugins/hu_currentlyplaying/__init__.pyc b/plugins/hu_currentlyplaying/__init__.pyc new file mode 100644 index 0000000..c7a7683 Binary files /dev/null and b/plugins/hu_currentlyplaying/__init__.pyc differ diff --git a/hu_currentlyplaying/currentlyPlaying.applescript b/plugins/hu_currentlyplaying/currentlyPlaying.applescript similarity index 100% rename from hu_currentlyplaying/currentlyPlaying.applescript rename to plugins/hu_currentlyplaying/currentlyPlaying.applescript diff --git a/hu_currentlyplaying/hu_currentlyplaying.py b/plugins/hu_currentlyplaying/hu_currentlyplaying.py similarity index 100% rename from hu_currentlyplaying/hu_currentlyplaying.py rename to plugins/hu_currentlyplaying/hu_currentlyplaying.py diff --git a/plugins/hu_currentlyplaying/hu_currentlyplaying.pyc b/plugins/hu_currentlyplaying/hu_currentlyplaying.pyc new file mode 100644 index 0000000..3d15c64 Binary files /dev/null and b/plugins/hu_currentlyplaying/hu_currentlyplaying.pyc differ diff --git a/hu_googleweather/__init__.py b/plugins/hu_googleweather/__init__.py similarity index 100% rename from hu_googleweather/__init__.py rename to plugins/hu_googleweather/__init__.py diff --git a/plugins/hu_googleweather/__init__.pyc b/plugins/hu_googleweather/__init__.pyc new file mode 100644 index 0000000..3b3041e Binary files /dev/null and b/plugins/hu_googleweather/__init__.pyc differ diff --git a/hu_googleweather/hu_googleweather.py b/plugins/hu_googleweather/hu_googleweather.py similarity index 92% rename from hu_googleweather/hu_googleweather.py rename to plugins/hu_googleweather/hu_googleweather.py index fdbf7dc..38bd3a3 100644 --- a/hu_googleweather/hu_googleweather.py +++ b/plugins/hu_googleweather/hu_googleweather.py @@ -1,4 +1,4 @@ -location = "brisbane,australia" +location = "athens, georgia, USA" import pywapi diff --git a/plugins/hu_googleweather/hu_googleweather.pyc b/plugins/hu_googleweather/hu_googleweather.pyc new file mode 100644 index 0000000..a4b7f86 Binary files /dev/null and b/plugins/hu_googleweather/hu_googleweather.pyc differ diff --git a/hu_googleweather/pywapi.py b/plugins/hu_googleweather/pywapi.py similarity index 100% rename from hu_googleweather/pywapi.py rename to plugins/hu_googleweather/pywapi.py diff --git a/hu_googleweather/pywapi.pyc b/plugins/hu_googleweather/pywapi.pyc similarity index 86% rename from hu_googleweather/pywapi.pyc rename to plugins/hu_googleweather/pywapi.pyc index abb900d..81e0631 100755 Binary files a/hu_googleweather/pywapi.pyc and b/plugins/hu_googleweather/pywapi.pyc differ diff --git a/hu_lastfm/__init__.py b/plugins/hu_lastfm/__init__.py similarity index 100% rename from hu_lastfm/__init__.py rename to plugins/hu_lastfm/__init__.py diff --git a/plugins/hu_lastfm/__init__.pyc b/plugins/hu_lastfm/__init__.pyc new file mode 100644 index 0000000..251f20b Binary files /dev/null and b/plugins/hu_lastfm/__init__.pyc differ diff --git a/hu_lastfm/hu_lastfm.py b/plugins/hu_lastfm/hu_lastfm.py similarity index 98% rename from hu_lastfm/hu_lastfm.py rename to plugins/hu_lastfm/hu_lastfm.py index 3ecf64a..5638fdc 100644 --- a/hu_lastfm/hu_lastfm.py +++ b/plugins/hu_lastfm/hu_lastfm.py @@ -1,4 +1,4 @@ -lastfm_username="scottjacksonx" +lastfm_username="gendanvs" import pylast as lastfm import time diff --git a/hu_lastfm/hu_lastfm.pyc b/plugins/hu_lastfm/hu_lastfm.pyc similarity index 52% rename from hu_lastfm/hu_lastfm.pyc rename to plugins/hu_lastfm/hu_lastfm.pyc index ddecf78..6af6fa9 100644 Binary files a/hu_lastfm/hu_lastfm.pyc and b/plugins/hu_lastfm/hu_lastfm.pyc differ diff --git a/hu_lastfm/pylast.py b/plugins/hu_lastfm/pylast.py similarity index 100% rename from hu_lastfm/pylast.py rename to plugins/hu_lastfm/pylast.py diff --git a/plugins/hu_lastfm/pylast.pyc b/plugins/hu_lastfm/pylast.pyc new file mode 100644 index 0000000..5996673 Binary files /dev/null and b/plugins/hu_lastfm/pylast.pyc differ diff --git a/hu_openapps/__init__.py b/plugins/hu_openapps/__init__.py similarity index 100% rename from hu_openapps/__init__.py rename to plugins/hu_openapps/__init__.py diff --git a/plugins/hu_openapps/__init__.pyc b/plugins/hu_openapps/__init__.pyc new file mode 100644 index 0000000..68ff051 Binary files /dev/null and b/plugins/hu_openapps/__init__.pyc differ diff --git a/hu_openapps/hu_openapps.py b/plugins/hu_openapps/hu_openapps.py similarity index 100% rename from hu_openapps/hu_openapps.py rename to plugins/hu_openapps/hu_openapps.py diff --git a/hu_openapps/hu_openapps.pyc b/plugins/hu_openapps/hu_openapps.pyc similarity index 50% rename from hu_openapps/hu_openapps.pyc rename to plugins/hu_openapps/hu_openapps.pyc index 8d9e4a9..26e0ca4 100644 Binary files a/hu_openapps/hu_openapps.pyc and b/plugins/hu_openapps/hu_openapps.pyc differ diff --git a/hu_openapps/openapps.applescript b/plugins/hu_openapps/openapps.applescript similarity index 78% rename from hu_openapps/openapps.applescript rename to plugins/hu_openapps/openapps.applescript index 521a7cd..a89bf6c 100644 --- a/hu_openapps/openapps.applescript +++ b/plugins/hu_openapps/openapps.applescript @@ -2,7 +2,8 @@ tell application "System Events" set theApps to (name of every process whose visible is true and name is not "Finder" and name is not (my name as text)) set appList to "" repeat with appName in theApps - set appList to appList & "\n" + set appList to appList & " +" end repeat get appList end tell \ No newline at end of file diff --git a/hu_openbrowsertabs/__init__.py b/plugins/hu_openbrowsertabs/__init__.py similarity index 100% rename from hu_openbrowsertabs/__init__.py rename to plugins/hu_openbrowsertabs/__init__.py diff --git a/plugins/hu_openbrowsertabs/__init__.pyc b/plugins/hu_openbrowsertabs/__init__.pyc new file mode 100644 index 0000000..f55d90b Binary files /dev/null and b/plugins/hu_openbrowsertabs/__init__.pyc differ diff --git a/hu_openbrowsertabs/hu_openbrowsertabs.py b/plugins/hu_openbrowsertabs/hu_openbrowsertabs.py similarity index 90% rename from hu_openbrowsertabs/hu_openbrowsertabs.py rename to plugins/hu_openbrowsertabs/hu_openbrowsertabs.py index 3a0800f..d906631 100644 --- a/hu_openbrowsertabs/hu_openbrowsertabs.py +++ b/plugins/hu_openbrowsertabs/hu_openbrowsertabs.py @@ -4,7 +4,7 @@ def getData(): """ Gets the title and URL of every tab open in the specified web browser. """ - urls = commands.getoutput("osascript hu_openbrowsertabs/urls.applescript") + urls = commands.getoutput("osascript hu_openbrowsertabs/urls.applescript \"Google Chrome\"") if urls[0:18] != "hu_openbrowsertabs": return "\n" + urls + "" return "" \ No newline at end of file diff --git a/plugins/hu_openbrowsertabs/hu_openbrowsertabs.pyc b/plugins/hu_openbrowsertabs/hu_openbrowsertabs.pyc new file mode 100644 index 0000000..1e69c44 Binary files /dev/null and b/plugins/hu_openbrowsertabs/hu_openbrowsertabs.pyc differ diff --git a/plugins/hu_openbrowsertabs/urls.applescript b/plugins/hu_openbrowsertabs/urls.applescript new file mode 100644 index 0000000..89869df --- /dev/null +++ b/plugins/hu_openbrowsertabs/urls.applescript @@ -0,0 +1,16 @@ +set urls to "" +tell application "Google Chrome" + set window_list to windows + repeat with w in window_list + try + set tab_list to tabs of w + repeat with t in tab_list + set urls to urls & " +" + end repeat + on error + -- not all windows have tabs + end try + end repeat + get urls +end tell diff --git a/hu_ssidname/__init__.py b/plugins/hu_ssidname/__init__.py similarity index 100% rename from hu_ssidname/__init__.py rename to plugins/hu_ssidname/__init__.py diff --git a/plugins/hu_ssidname/__init__.pyc b/plugins/hu_ssidname/__init__.pyc new file mode 100644 index 0000000..13479f2 Binary files /dev/null and b/plugins/hu_ssidname/__init__.pyc differ diff --git a/hu_ssidname/hu_ssidname.py b/plugins/hu_ssidname/hu_ssidname.py similarity index 100% rename from hu_ssidname/hu_ssidname.py rename to plugins/hu_ssidname/hu_ssidname.py diff --git a/hu_ssidname/hu_ssidname.pyc b/plugins/hu_ssidname/hu_ssidname.pyc similarity index 53% rename from hu_ssidname/hu_ssidname.pyc rename to plugins/hu_ssidname/hu_ssidname.pyc index 34be0d2..47e4b93 100644 Binary files a/hu_ssidname/hu_ssidname.pyc and b/plugins/hu_ssidname/hu_ssidname.pyc differ