def test(ie):
	print('testing...')
	sql = 'select 1'
	resp = iegettext('http://geofibre.sso.francetelecom.fr/RestFmkSrvDeploy/orion/applications/clientorion/requeteBDD?date=Thu%20Jul%209%2015%3A23%3A38%20GMT%2B0200%202015&token=unknow&REQUETE=' + sql)
	if resp:
		resp = b64decode(resp.replace(b'\r\n', b''))
		if resp == b'{"reponse":{"error_sql":"","cols":[{"name":"?column?","type":4}],"colCount":1,"error_msg":"","rows":[["1"]]},"status":"ok"}':
			msgbox('la connexion a réussi!')
		else:
			msgbox('vous semblez ne pas être connécté!')
		abtronics.__main__()
def connect(show_panel=True):
	resp = True
	if abtronics.IE:
		resp = ccbox('Il semblerait que vous soyez déjà connécté! Voulez-vous vous reconnécter?')
	if resp:
		run('taskkill /IM iexplore.exe /F')
		run('taskkill /IM JuniperSetupClient.exe /F')
		run('taskkill /IM dsSamProxy.exe /F')
		run('taskkill /IM dsSamUI.exe /F')
		abtronics.IE = Dispatch('InternetExplorer.Application')
		abtronics.IE.Visible = False
		with open('D:\\Users\\denis13\\logins.json') as f:
			logins = load(f)
		choices = []
		for login in logins['logins']:
			choices.append(login['username'] + ' (' + login['password'] + ')')
		msg ="Quel compte voulez-vous utiliser?"
		title = "Choix du compte"
		choice = choicebox(msg, title, choices)
		account = choice.split(' ')[0]
		pwd = choice.split(' ')[1].replace('(', '').replace(')', '')
		print('you choosed:', account, pwd)
		abtronics.IE.Navigate('https://lyon.metagate.orange.com/dana-na/auth/logout.cgi')
		while abtronics.IE.Busy: sleep(1)
		abtronics.IE.Navigate('https://lyon.metagate.orange.com/dana-na/auth/url_default/welcome.cgi')
		while abtronics.IE.Busy: sleep(1)
		abtronics.IE.Document.all.item('username').value = account
		abtronics.IE.Document.all.item('password').value = pwd
		abtronics.IE.Document.all.item('btnSubmit_6').Click()
		while abtronics.IE.Busy: sleep(1)
		if abtronics.IE.Document.all.item('btnContinue'):
			abtronics.IE.Document.all.item('btnContinue').Click()
		while abtronics.IE.Busy: sleep(1)
		while 'Orange' not in abtronics.IE.Document.all.tags('title')[0].innerText:
			sleep(1)
		while abtronics.IE.Busy: sleep(1)
		abtronics.IE.Navigate('http://geofibre.sso.francetelecom.fr/geofibre/login.jsp')
		while abtronics.IE.Busy: sleep(1)
		if abtronics.IE.Document.all.item('overridelink'):
			abtronics.IE.Document.all.item('overridelink').Click()
		while abtronics.IE.Busy: sleep(1)
		abtronics.IE.Document.all.item('user').value = account
		abtronics.IE.Document.all.item('password').value = pwd
		abtronics.IE.Document.all.item('linkValidForm').Click()
		while abtronics.IE.Busy: sleep(1)
		# if abtronics.IE.Document.GetElementsByTagName('a'):
		# 	abtronics.IE.Document.GetElementsByTagName('a')[0].Click()
		# 	while abtronics.IE.Busy: sleep(1)
		abtronics.IE.Navigate('http://geofibre.sso.francetelecom.fr/RestFmkSrvDeploy/orion/applications/clientorion/gestionConnexion?action=connexion&codealliance=' + account)
		while abtronics.IE.Busy: sleep(1)
	if show_panel: abtronics.__main__()
	adduc_wb = xl.Workbooks.Open(adduc)
	for cell in adduc_wb.Sheets(1).Range('C8:C1000'):
		if cell.Value() == None:
			last_line = cell.Row - 1
			break
	print('> copying cells ...')
	adduc_wb.Sheets(1).Range('A1:V'+str(last_line)).Select()
	adduc_wb.Application.Selection.Copy()
	adduc_sheet.Range('A'+str(start_row)+':V'+str(start_row+last_line)).PasteSpecial(13)
	adduc_sheet.Range('A'+str(start_row)+':V'+str(start_row+last_line)).PasteSpecial(8)
	print('> resizing rows ...')
	for row in adduc_wb.Sheets(1).Rows:
		if row.Row > last_line:
			break
		adduc_sheet.Range('A'+str(row.Row+start_row-1)+':V'+str(row.Row+start_row-1)).RowHeight = row.RowHeight
		temp_start_row = row.Row+start_row-1
	start_row = temp_start_row + 1
	adduc_wb.Close()

for adduc in ADDUCS:
	print('merging', dirname(adduc), '...')
	merge(adduc)

print('done')

pa_wb.Save()
xl.Quit()

call("C:\Windows\explorer.exe " + dirname(PA), shell=True)
abtronics.__main__()
Beispiel #4
0
def ask_to_connect_geo():
	if ccbox('Vous n\'êtes pas encore connécté, voulez-vous le faire maintenant?', 'Connéxion à géofibre'):
		import abtronics.service.geofibre_connection
		abtronics.service.geofibre_connection.connect(show_panel=False)
	else:
		abtronics.__main__()