示例#1
0
def download(magnet, season, episode, show):
    global IP, USER, PASS

    cmd = "transmission-remote "
    cmd = cmd + "%s -n %s:%s --add '%s'" % (IP, USER, PASS, magnet)
    #print cmd
    os.system(cmd)
    
    updateEpisode  = episode + 1
    service1 = Service()
    service1.updateShow(show, season, updateEpisode)
示例#2
0
import inspect

argList = sys.argv
try:
    name = argList[1]
    season = argList[2]
    episode = argList[3]
    avail = argList[4]
    action = argList[5]
except:
    print "ERROR <tv name> <season> <epsisde> <avail>"
    sys.exit(1)
  
  
if action == "add":
	dbService = Service()
  	print dbService.addNewShow(name, season, episode)

elif action == "show":
  	dbService = Service()
  	print dbService.getAllShows()

elif action == "continue":
  	dbService = Service()
  	print dbService.continueShow(name)

elif action == "halt":
	dbService = Service()
  	print dbService.haltShow(name)

示例#3
0
import glob
import os

appPush = App(appid='', secret='')

os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
base_dir = '/sys/bus/w1/devices/'

device_folder1 = glob.glob(base_dir + '')[0]
device_file1 = device_folder1 + '/w1_slave'

device_folder2 = glob.glob(base_dir + '')[0]
device_file2 = device_folder2 + '/w1_slave'

service = Service()
#dbArr = service.getAllHeater()
scheduler = BackgroundScheduler()

logging.basicConfig()

PIN1 = 18 #pump
PIN2 = 23 #boost
PIN3 = 24 #water
PIN4 = 25 #door sensor
#GPIO 4 = tempSensor

welcomeHomeBash = './chat.sh'

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
示例#4
0
def getSQL():
	
	tvArray = [TVClass]
	service = Service()
	tvArray = service.returnShows()
	return tvArray