Skip to content

Commit

Permalink
Growl messages added and interval for clipboard inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrés Bravo Gorgonio authored and Andrés Bravo Gorgonio committed Aug 26, 2010
1 parent a0d64b7 commit 79557e0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
9 changes: 7 additions & 2 deletions README
Expand Up @@ -10,11 +10,16 @@ In fact, what downtify do is getting the song info, search it in youtube and get

REQUERIMENTS:

No requeriments to use when we do the first pakage
To Use:

- Jdownloader with paperClip inpector activated (download manager)
- No pyhton requeriments to use when we have done the first pakage


To developping

- python 2.6
- Tkinter
- Growl (optional)
- Gdata for python
- gNotify python module (provided in growl SDK package)
- Gdata for python (Google Data python module)
24 changes: 23 additions & 1 deletion downtify.py
@@ -1,3 +1,10 @@
# HOW TO SET INTERVALS
# def hello():
# print "hello, world"
#
# t = Timer(30.0, hello)
# t.start() # after 30 seconds, "hello, world" will be printed


import sys
sys.path.append('/Users/andresbravogorgonio/Documents/Proyectos/Downtify/SRC/downtify/')
Expand All @@ -10,6 +17,10 @@
from HTMLParser import HTMLParser
import gdata.youtube.service
import macOSclipboard
import growlNotify

from threading import Timer




Expand Down Expand Up @@ -69,7 +80,8 @@ def __init__(self, master):
self.button_get_info.pack(side=RIGHT)

#self.configuration()

#Start the ClipBoard inspect with the
self.getSpotifyLinks()

def configuration(self):
#Reader read configuration file
Expand All @@ -88,14 +100,22 @@ def getSpotifyLinks(self):
#Parsing urls from archive
f = macOSclipboard.paste()
if f.find('http://open.spotify.com') != -1 :
growlNotify.gNotify('Tratando los enlaces del portapapeles','Downtify')
self.urls = []
for line in f.split('\n'):
if line.find('http://open.spotify.com') == 0 :
self.urls += [ line ]
self.list.insert(END, line)
print line
#TODO: we have to manage better the cliboard when we finish to parse
macOSclipboard.copy('')
#Automatizate the process
self.getSongsInfo()

else :
print "No spotify urls in clipboard"
t = Timer(1.0, self.getSpotifyLinks)
t.start()

def getSongsInfo(self):
#Reader read configuration file
Expand Down Expand Up @@ -183,13 +203,15 @@ def parseHtmlArchive (self, filename):
archiveparser = SpiderParser(filename)
parsedInfo = archiveparser.getParsedInfo()
print "gettin the info from the parser"+ parsedInfo
growlNotify.gNotify('Getting song: '+ parsedInfo ,'Downtify' )
return parsedInfo

def yview(self, *args):
apply(self.list.yview, args)

def test_connection(self):
if os.system("ping -c 2 www.google.com"):
growlNotify.gNotify('No tienes conexion a internet ;(')
return False
else:
return True
Expand Down
22 changes: 22 additions & 0 deletions growlNotify.py
@@ -0,0 +1,22 @@
import time
import Growl


class MyNotifier(Growl.GrowlNotifier):
applicationName = 'Downtify'
notifications = ['ntf1']

def gNotify(message='', action='') :
growl = MyNotifier()
growl.register()
growl.notify('ntf1', message , action)

def main():
growl = MyNotifier()
growl.register()


__all__ = ['gNotify', 'main']

if __name__ == "__main__":
main()
Binary file added growlNotify.pyc
Binary file not shown.

0 comments on commit 79557e0

Please sign in to comment.