def main(client): customer_ids = list(all_clients.keys()) # print(customer_ids) # return account_performance_data = [] start_time = time.time() # Entering the data in timestamp file. time_stamp_file_path = utility.get_path_of_timestamp_file( BASE_DIR, SCRIPT_NAME) #print(('Time stamp path : '+time_stamp_file_path)) timestamp_file = open(time_stamp_file_path, "a+") current_time = time.asctime(time.localtime(time.time())) timestamp_file.write("\n*************************************************") timestamp_file.write("\n" + SCRIPT_NAME + " Script running started on " + str(len(customer_ids)) + " accounts,start time: " + current_time) timestamp_file.close() logic.main(client, customer_ids, time_stamp_file_path, API_VERSION, account_performance_data)
def lite(inlets, flow_dir_raster, slope_raster, cn_raster, precip_table_noaa, output, pour_point_field): """ Peak-Flow Calculator "Lite". Use with pre-calculated slope and flow direction rasters. """ return main(inlets=inlets, pour_point_field=pour_point_field, flow_dir_raster=flow_dir_raster, slope_raster=slope_raster, cn_raster=cn_raster, precip_table_noaa=precip_table_noaa, output=output)
def full(inlets, dem, cn_raster, precip_table_noaa, pour_point_field, output): """ Peak-Flow Calculator "Full". Use to automatically calculate flow direction and slope from DEM. """ msg('Deriving flow direction and slop from DEM...') derived_rasters = derive_from_dem(dem=dem) flow_dir_raster = derived_rasters['flow_direction_raster'] slope_raster = derived_rasters['slope_raster'] return main(inlets=inlets, pour_point_field=pour_point_field, flow_dir_raster=flow_dir_raster, slope_raster=slope_raster, cn_raster=cn_raster, precip_table_noaa=precip_table_noaa, output=output)
''' peakflow2_tbx.py ArcToolbox script interface to the peak flow tool. Includes an additional argument for inputing a pre-calculated basin layer, which speeds up the execution time. ''' from arcpy import GetParameterAsText from logic import main main(inlets=GetParameterAsText(0), pour_point_field=GetParameterAsText(1), input_watershed_raster=GetParameterAsText(2), flow_dir_raster=GetParameterAsText(3), slope_raster=GetParameterAsText(4), cn_raster=GetParameterAsText(5), precip_table_noaa=GetParameterAsText(6), output=GetParameterAsText(7), output_catchments=GetParameterAsText(8))
from logic import main main()
# -*- coding: utf-8 -*- import logic if __name__ == "__main__": logic.main()
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # File: launcher.py # Date: 2010-08-18 # Author: jyf<*****@*****.**> # Comment: this is job control script """i will give my thanks to 58.com, they provide the infomations""" import logic endDate = ( 8, 15) ##dstarea = ('shuangjing', 'tuanjiehu', 'chaoyanggongyuan', 'hujialou', 'dongba', 'yaojiayuan', 'shuiduizi', 'tianshuiyuan', 'chaoqingbankuai', 'shifoying', 'shilibao', 'hongmiao'): dstarea = ('tuanjiehu', 'chaoyanggongyuan', 'hujialou', 'shuiduizi', 'tianshuiyuan', 'hongmiao') for loc in dstarea: for cls in ('hezu', 'zufang'): url = """http://bj.58.com/%s/%s/pn1""" % ( loc, cls) logic.main(url, endDate)
def quit(): main()
def search(): logic.main(e1.get(), e2.get())
def setUp(self): from logic import main app = main({}) from webtest import TestApp self.testapp = TestApp(app)
''' peakflow2_tbx.py ArcToolbox script interface to the peak flow tool. ''' from arcpy import GetParameterAsText from logic import main main(inlets=GetParameterAsText(0), flow_dir_raster=GetParameterAsText(1), slope_raster=GetParameterAsText(2), cn_raster=GetParameterAsText(3), precip_table_noaa=GetParameterAsText(4), output=GetParameterAsText(5), output_catchments=GetParameterAsText(6))