Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan committed Feb 22, 2013
1 parent ff709c6 commit 1b7c898
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
17 changes: 17 additions & 0 deletions app/__init__.py
Expand Up @@ -101,6 +101,23 @@ def hasSubtitle(f):
return True
return False

def findThisProcess( process_name ):
ps = subprocess.Popen("ps -eaf | grep "+process_name, shell=True, stdout=subprocess.PIPE)
output = ps.stdout.read()
ps.stdout.close()
ps.wait()

return output

def isThisRunning( process_name ):
output = findThisProcess( process_name )

if re.search("/bin/" + process_name, output) is None:
return False
else:
return True


""" Logger (not in use, but can be used for debugging purposes """
log = Logger('HandleBar')

Expand Down
9 changes: 7 additions & 2 deletions convert.py
Expand Up @@ -127,7 +127,9 @@ def run(self):
"""

time.sleep(5)
hb.check()

if isThisRunning('HandbrakeCLI') == False:
hb.check()

if __name__ == "__main__":

Expand All @@ -141,7 +143,10 @@ def run(self):
elif 'restart' == sys.argv[1]:
daemon.restart()
elif 'test' == sys.argv[1]:
hb.check()
if isThisRunning('HandbrakeCLI') == False:
hb.check()
else:
print "ai"
elif 'metatest' == sys.argv[1]:
md = metadata(sys.argv[2], 1)
result = md.parseFile()
Expand Down

0 comments on commit 1b7c898

Please sign in to comment.