Пример #1
0
	export =\
		b64decode(
			loads(
				get("http://geofibre.sso.francetelecom.fr/RestFmkSrvDeploy/orion/applications/clientorion/exportImb?token=unknow&auteur=djhc1710&filename="
					+ quote(filename_exportImbSoe)
				).decode('utf-8')
			)['detail'].replace('\n', ''))


	with open(__JOB_PATH__ + sep + code.replace('/', '_') + '.csv', 'wb') as file_:
		file_.write(codecs.BOM_UTF8)
		file_.write(export)

codes = sql("select num_ordre, code_com, id_metier_site, type_site from ftth_pf where num_ordre_pf_pere='" + code_ + "' and type_pf='PB' and code_com='" + insee + "'")
print('\n\n => PFs de type PB ayant pour PF père ' + code_ + ' et INSEE ' + insee)
print(prettify_sql_response(codes))
codes = sql_response_as_list(codes)

listPB = []

for i, code in enumerate(codes):
	get_export(code['code_com'], code['num_ordre'], nro)
	listPB.append({})
	listPB[i]['PB'] = code['num_ordre']
	if code['type_site'] == 'Appui FTTH':
		sql_return = sql("select num_voie, nom_voie, commentaire from ftth_site_appui_ft where id_metier_site='" + code['id_metier_site'] + "'")
		print('\n\n => Infos: num_voie, nom_voie, commentaire pour id_metier_site ' + code['id_metier_site'])
		print(prettify_sql_response(sql_return))

		sql_return = sql_response_as_list(sql_return)
		sql_return = sql_return[0]
Пример #2
0
	export =\
		b64decode(
			loads(
				get("http://geofibre.sso.francetelecom.fr/RestFmkSrvDeploy/orion/applications/clientorion/exportImb?token=unknow&auteur=djhc1710&filename="
					+ quote(filename_exportImbSoe)
				).decode('utf-8')
			)['detail'].replace('\n', ''))

	with open(__JOB_PATH__ + sep + code.replace('/', '_') + '.csv', 'wb') as file_:
		file_.write(codecs.BOM_UTF8)
		file_.write(export)

codes = sql("select num_ordre, code_com, id_metier_site, type_site from ftth_pf where num_ordre_pf_pere='" + code_ + "' and type_pf='PB' and code_com='" + insee + "'")
print('\n\n => PFs de type PB ayant pour PF père ' + code_ + ' et INSEE ' + insee)
print(prettify_sql_response(codes))
codes = sql_response_as_list(codes)

listPB = []

for i, code in enumerate(codes):
	get_export(code['code_com'], code['num_ordre'], nro)
	listPB.append({})
	listPB[i]['PB'] = code['num_ordre']
	if code['type_site'] == 'Appui FTTH':
		sql_return = sql("select num_voie, nom_voie, commentaire from ftth_site_appui_ft where id_metier_site='" + code['id_metier_site'] + "'")
		sql_return = sql_response_as_list(sql_return)
		sql_return = sql_return[0]
		comment = sql("select commentaire from ftth_pf where id_metier_site='" + code['id_metier_site'] + "'")
		comment = sql_response_as_list(comment)
		if sql_return: