Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Hi #2

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Privacy #
##################
hu-notes.txt

# Basic OS Stuff #
##################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
72 changes: 0 additions & 72 deletions hu-notes.txt

This file was deleted.

12 changes: 7 additions & 5 deletions hu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
import time
import os
import os, sys, inspect

class hu:

Expand All @@ -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):
"""
Expand Down
Binary file removed hu_currentlyplaying/__init__.pyc
Binary file not shown.
Binary file removed hu_currentlyplaying/hu_currentlyplaying.pyc
Binary file not shown.
Binary file removed hu_googleweather/__init__.pyc
Binary file not shown.
Binary file removed hu_googleweather/hu_googleweather.pyc
Binary file not shown.
Binary file removed hu_lastfm/__init__.pyc
Binary file not shown.
Binary file removed hu_lastfm/pylast.pyc
Binary file not shown.
Binary file removed hu_openapps/__init__.pyc
Binary file not shown.
Binary file removed hu_openbrowsertabs/__init__.pyc
Binary file not shown.
Binary file removed hu_openbrowsertabs/hu_openbrowsertabs.pyc
Binary file not shown.
15 changes: 0 additions & 15 deletions hu_openbrowsertabs/urls.applescript

This file was deleted.

Binary file removed hu_ssidname/__init__.pyc
Binary file not shown.
Empty file added plugins/__init__.py
Empty file.
Binary file added plugins/__init__.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions plugins/hu_batterypower/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import hu_batterypower
Binary file added plugins/hu_batterypower/__init__.pyc
Binary file not shown.
56 changes: 56 additions & 0 deletions plugins/hu_batterypower/hu_batterypower.py
Original file line number Diff line number Diff line change
@@ -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 = "<power state=\"" + powerState + "\""
if powerSource != "":
outputString = outputString + " source=\"" + powerSource + "\""
if percentage != "":
outputString = outputString + " percent=\"" + percentage + "%\""
if time != "":
outputString = outputString + " time=\"" + time + "\""
outputString = outputString + "/>"
return outputString










Binary file added plugins/hu_batterypower/hu_batterypower.pyc
Binary file not shown.
Binary file added plugins/hu_currentlyplaying/__init__.pyc
Binary file not shown.
Binary file added plugins/hu_currentlyplaying/hu_currentlyplaying.pyc
Binary file not shown.
File renamed without changes.
Binary file added plugins/hu_googleweather/__init__.pyc
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
location = "brisbane,australia"
location = "athens, georgia, USA"

import pywapi

Expand Down
Binary file added plugins/hu_googleweather/hu_googleweather.pyc
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file added plugins/hu_lastfm/__init__.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion hu_lastfm/hu_lastfm.py → plugins/hu_lastfm/hu_lastfm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lastfm_username="scottjacksonx"
lastfm_username="gendanvs"

import pylast as lastfm
import time
Expand Down
Binary file not shown.
File renamed without changes.
Binary file added plugins/hu_lastfm/pylast.pyc
Binary file not shown.
File renamed without changes.
Binary file added plugins/hu_openapps/__init__.pyc
Binary file not shown.
File renamed without changes.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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 & "<app name=\"" & appName & "\" />\n"
set appList to appList & "<app name=\"" & appName & "\" />
"
end repeat
get appList
end tell
File renamed without changes.
Binary file added plugins/hu_openbrowsertabs/__init__.pyc
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<browser>\n" + urls + "</browser>"
return ""
Binary file added plugins/hu_openbrowsertabs/hu_openbrowsertabs.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions plugins/hu_openbrowsertabs/urls.applescript
Original file line number Diff line number Diff line change
@@ -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 & "<tab " & "title=\"" & title of t & "\" url=\"" & URL of t & "\" />
"
end repeat
on error
-- not all windows have tabs
end try
end repeat
get urls
end tell
File renamed without changes.
Binary file added plugins/hu_ssidname/__init__.pyc
Binary file not shown.
File renamed without changes.
Binary file not shown.