SHARE
TWEET

Untitled

a guest Mar 19th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pyodbc
  2.  
  3. ####   --->>>Connection to SQL Server
  4.  
  5. conn = pyodbc.connect('Driver={SQL Server};'
  6.                       'Server=****Mi servidor****;'
  7.                       'UID=***Usuario****;'
  8.                       'PWD=***password***;'
  9.                       'database=voiceData;'
  10.                       'Trusted_Connection=yes;'
  11.                       )
  12.  
  13. cursor = conn.cursor()
  14. cursor.execute('EXECUTE dbo.GET_localOfficeAvayaFilePaths')
  15.  
  16.  
  17. ####  --->>>Changes on the 46xxsettings.txt file
  18. for row in cursor:
  19. print('', row[3])
  20. string_map = {'## SET SLMSRVR': 'SET SLMSRVR 192.168.1.1', '## SET SLMSTAT
  21. 1': 'SET SLMSTAT 1',
  22.               '## SET SLMPERF 1': 'SET SLMPERF 1',
  23.               '## SET SLMCAP 1': 'SET SLMCAP 2', 'SET SLMCTRL 1': 'SET SLMCTRL 1'}
  24.  
  25. for line in cursor.readlines():
  26.     if line.startswith('## SET'):
  27.         for original, new in string_map.items():
  28.             if original in line:
  29.                 line = new
  30.                 break
  31.     print(line.strip())
  32.  
  33. cursor.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top