Clean up. Updated requirements.txt

This commit is contained in:
Dan Dembinski
2021-02-19 13:43:47 -05:00
parent c0710262a1
commit 788521ae99
2 changed files with 19 additions and 18 deletions

36
main.py
View File

@@ -63,9 +63,10 @@ session = Session()
for user in session.query(User).filter(User.ID == 14): for user in session.query(User).filter(User.ID == 14):
ActiveUser.append([user.ID, user.FirstName, user.LastName]) ActiveUser.append([user.ID, user.FirstName, user.LastName])
# loop through each user in the ActiveUser array # loop through each user in the ActiveUser array. Combine Users First/Last name for the filename and
# the first letter/last name combo for username
for each in ActiveUser: for each in ActiveUser:
# Combine Users First/Last name into single variable #
FileName = each[1] + ' ' + each[2] FileName = each[1] + ' ' + each[2]
UserName = each[1][0]+each[2] UserName = each[1][0]+each[2]
@@ -74,21 +75,21 @@ for each in ActiveUser:
ws = wb.add_sheet('Addresses') ws = wb.add_sheet('Addresses')
# Write header row # Write header row
ws.write(0,0,'ACTION') ws.write(0, 0, 'ACTION')
ws.write(0,1,'BU_ID') ws.write(0, 1, 'BU_ID')
ws.write(0,2,'LOGIN_ID') ws.write(0, 2, 'LOGIN_ID')
ws.write(0,3,'PA_NAME') ws.write(0, 3, 'PA_NAME')
ws.write(0,4, 'PA_NAME2') ws.write(0, 4, 'PA_NAME2')
ws.write(0,5,'LINE1') ws.write(0, 5, 'LINE1')
ws.write(0,6,'LINE2') ws.write(0, 6, 'LINE2')
ws.write(0,7,'LINE3') ws.write(0, 7, 'LINE3')
ws.write(0,8,'CITY') ws.write(0, 8, 'CITY')
ws.write(0,9,'STATE') ws.write(0, 9, 'STATE')
ws.write(0,10,'ZIP') ws.write(0, 10, 'ZIP')
ws.write(0,11,'COUNTRY') ws.write(0, 11, 'COUNTRY')
ws.write(0,12,'PHONE_NR') ws.write(0, 12, 'PHONE_NR')
ws.write(0,13,'SHIP_TO_ATTN_TX') ws.write(0, 13, 'SHIP_TO_ATTN_TX')
ws.write(0,14, 'PROFILE_TYPE') ws.write(0, 14, 'PROFILE_TYPE')
# For each username we're filtering the UserAddress table by their userID and adding it to the UserAddressID array. # For each username we're filtering the UserAddress table by their userID and adding it to the UserAddressID array.
@@ -102,7 +103,6 @@ for each in ActiveUser:
# Combine all the required fields into one variable for simplicity # Combine all the required fields into one variable for simplicity
AddresssBookLine = UserName, cn[0].CompanyName, cn[0].Line1, cn[0].Line2, cn[0].City, cn[1].StateName, cn[0].PostalCode, cn[2].CountryName, cn[0].PhoneNumber,cn[0].ContactName AddresssBookLine = UserName, cn[0].CompanyName, cn[0].Line1, cn[0].Line2, cn[0].City, cn[1].StateName, cn[0].PostalCode, cn[2].CountryName, cn[0].PhoneNumber,cn[0].ContactName
# Loop through each row and populate the variable columns with the corresponding AddressBookLine element # Loop through each row and populate the variable columns with the corresponding AddressBookLine element
print(LineCount)
ws.write(LineCount, 2, AddresssBookLine[0]) ws.write(LineCount, 2, AddresssBookLine[0])
ws.write(LineCount, 3, AddresssBookLine[1]) ws.write(LineCount, 3, AddresssBookLine[1])
ws.write(LineCount, 5, AddresssBookLine[2]) ws.write(LineCount, 5, AddresssBookLine[2])

View File

@@ -1,2 +1,3 @@
pymssql==2.1.5 pymssql==2.1.5
SQLAlchemy==1.3.23 SQLAlchemy==1.3.23
xlwt==1.3.0