def validStart(): if not os.path.exists(RESOURCES): __runProcess__('mkdir %s' % __formatSpaces__(RESOURCES)) if not os.path.exists(OAUTH_JSON): __runProcess__('touch %s' % __formatSpaces__(OAUTH_JSON)) if not os.path.exists('%s/webdrivers' % RESOURCES): __runProcess__('mkdir %s' % __formatSpaces__('%s/webdrivers' % RESOURCES)) if not os.path.exists(SUBSCRIPTIONS): __runProcess__('mkdir %s' % __formatSpaces__(SUBSCRIPTIONS)) requiredInstalls = [] for i in DEPENDENCIES: if not 'True' in __runProcess__( '%s --is-installed %s %s' % (PKG_MANAGER, i['title'], i['dest'])).split('\n')[0]: requiredInstalls.append(i) if len(requiredInstalls) > 0: newDependencies = '' newDestinations = '' for i in requiredInstalls: newDependencies = '%s %s' % (newDependencies, i['title']) newDestinations = '%s %s' % (newDestinations, i['dest']) __runProcess__('%s -i%s -o%s' % (PKG_MANAGER, newDependencies, newDestinations)) __runProcess__('%s -light -light -dark -dark --suppress' % GLYPHMANAGER) import OmniAuth OmniAuth.validStart()
def jsonLoad(baseURL, param1 = {}): import OmniAuth if len(param1) > 0: return json.loads(urllib.urlopen('%s?access_token=%s&v=%s&alt=json&%s' % (baseURL, OmniAuth.getOAuth()['access_token'], '2', urllib.urlencode(param1))).read()) else: return json.loads(urllib.urlopen('%s&access_token=%s' % (baseURL, OmniAuth.getOAuth()['access_token'])).read())
def jsonLoad(baseURL, param1={}): import OmniAuth if len(param1) > 0: return json.loads( urllib.urlopen('%s?access_token=%s&v=%s&alt=json&%s' % (baseURL, OmniAuth.getOAuth()['access_token'], '2', urllib.urlencode(param1))).read()) else: return json.loads( urllib.urlopen( '%s&access_token=%s' % (baseURL, OmniAuth.getOAuth()['access_token'])).read())
def postLoad(): import OmniAuth return {'GData-Version':'2', 'Authorization':'Bearer %s' % OmniAuth.getOAuth()['access_token'], 'X-GData-Key':'key=%s' % base64.b64decode(DEVELOPER_KEY), 'Content-Type':'application/atom+xml', 'Host':'gdata.youtube.com'}
def postLoad(): import OmniAuth return { 'GData-Version': '2', 'Authorization': 'Bearer %s' % OmniAuth.getOAuth()['access_token'], 'X-GData-Key': 'key=%s' % base64.b64decode(DEVELOPER_KEY), 'Content-Type': 'application/atom+xml', 'Host': 'gdata.youtube.com' }
def validStart(): if not os.path.exists(RESOURCES): __runProcess__('mkdir %s' % __formatSpaces__(RESOURCES)) if not os.path.exists(OAUTH_JSON): __runProcess__('touch %s' % __formatSpaces__(OAUTH_JSON)) if not os.path.exists('%s/webdrivers' % RESOURCES): __runProcess__('mkdir %s' % __formatSpaces__('%s/webdrivers' % RESOURCES)) if not os.path.exists(SUBSCRIPTIONS): __runProcess__('mkdir %s' % __formatSpaces__(SUBSCRIPTIONS)) requiredInstalls = [] for i in DEPENDENCIES: if not 'True' in __runProcess__('%s --is-installed %s %s' % (PKG_MANAGER, i['title'], i['dest'])).split('\n')[0]: requiredInstalls.append(i) if len(requiredInstalls) > 0: newDependencies = '' newDestinations = '' for i in requiredInstalls: newDependencies = '%s %s' % (newDependencies, i['title']) newDestinations = '%s %s' % (newDestinations, i['dest']) __runProcess__('%s -i%s -o%s' % (PKG_MANAGER, newDependencies, newDestinations)) __runProcess__('%s -light -light -dark -dark --suppress' % GLYPHMANAGER) import OmniAuth OmniAuth.validStart()