def logUser(self, appEnumString): cherrypy.session['selectedEnum'] = appEnumString appEnum = getEnumFromAppName(appEnumString) CookieInjector() Logger() oauthUrl = getRequestToken(ConsumerKeyString[appEnum], ConsumerSecretString[appEnum]) print("authorization Url:" + oauthUrl) raise cherrypy.HTTPRedirect(oauthUrl)
folder = "c:/temp/decid/" scale = 30 cutoff = 4000 fire_year_limit = 1900 elev_lim = 500 Handler(dirname=folder).dir_create() OUTFILE = folder + \ 'gee_mack_data_extract_{}_v{}.csv'.format(str(scale),datetime.datetime.now().isoformat() .split('.')[0].replace('-', '_').replace(':', '_')) logfile = OUTFILE.split('.csv')[0] + '.log' log = Logger('SAMP', filename=logfile, stream=True) log.lprint('Outfile: {}'.format(OUTFILE)) log.lprint('Logfile: {}'.format(logfile)) decid_layer = ee.Image( "users/masseyr44/decid/decid_mosaic_2000_prediction_vis_nd_3") nlcd = ee.Image("users/masseyr44/decid/Alaska_NLCD_2011") ak_fire = ee.FeatureCollection( "users/masseyr44/shapefiles/AK_fire_database") ak_interior = ee.FeatureCollection( "users/masseyr44/shapefiles/alaska_interior_zones") tc2000 = ee.Image( "users/masseyr44/decid/ABoVE_median_SR_NDVI_boreal_2000_tc_prediction_MM"
return bins if __name__ == '__main__': ee.Initialize() folder = "C:/Users/rm885/Dropbox/projects/NAU/landsat_deciduous/data/" OUTFILE = folder + 'SAMPLES/gee_extract/' + \ 'gee_samp_extract_short_v{}.csv'.format(datetime.datetime.now().isoformat() .split('.')[0].replace('-', '_').replace(':', '_')) logfile = OUTFILE.split('.csv')[0] + '.log' log = Logger('SAMP', filename=logfile, stream=True) log.lprint('Outfile: {}'.format(OUTFILE)) log.lprint('Logfile: {}'.format(logfile)) file1 = folder + "SAMPLES/BNZ_LTER/mack_data_transects_ba.shp" file2 = folder + "SAMPLES/CAFI/CAFI_PSP.shp" file3 = folder + "SAMPLES/" + \ "CAN_NFI/Canada_NFI/From_Jackie_11_17_17/Originial_Canada_data/data/NFI_plots_sample_site_data_July_26_2013.shp" file4 = folder + "SAMPLES/CAN_PSP/PSP_data/CAN_PSP_all_v3_above.shp" file5 = folder + "SAMPLES/NWT/Chronosequence_BA_data_JB.shp" file6 = folder + "SAMPLES/NWT/NWT_site_tree_data.shp" file7 = folder + "SAMPLES/CAN_PSP/CAN_PSP_V2.shp" file8 = folder + "SAMPLES/CAN_PSP/Yukon_PSP.shp" file9 = folder + "SAMPLES/NWT/NWT_PSP.shp"
from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains import time import pymysql from modules import Util from modules import Logger url = 'https://music.163.com/' logger = Logger.Logger(__file__) util = Util.Util() def run(url): db = pymysql.connect("111.230.244.113", "root", "10001000", "music") cursor = db.cursor() try: driver = webdriver.Chrome() driver.implicitly_wait(10) driver.get(url) driver.maximize_window() time.sleep(5) hand = driver.find_element_by_xpath("//div[@class='hand']") ActionChains(driver).move_to_element(hand).perform() time.sleep(0.5) driver.execute_script('document.getElementsByClassName("left f-fl")[0].children[0].click()') current_handle = driver.current_window_handle hot_iframe = driver.find_element_by_xpath("//iframe[@id='g_iframe']") driver.switch_to.frame(hot_iframe) # 处理首页歌单 index_hot = driver.find_elements_by_xpath( "//div[@id='discover-module']//ul[@class='m-cvrlst f-cb']/li/div[@class='u-cover u-cover-1']")
def __init__(self): # we only want to log the GPIO-Errors ONE time. self.alreadyLoggedGPIOError = False self.logger = Logger.Logger(self.__class__.__name__).get()