Clean up. Updated requirements.txt
This commit is contained in:
36
main.py
36
main.py
@@ -63,9 +63,10 @@ session = Session()
|
||||
for user in session.query(User).filter(User.ID == 14):
|
||||
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:
|
||||
# Combine Users First/Last name into single variable
|
||||
#
|
||||
FileName = each[1] + ' ' + each[2]
|
||||
UserName = each[1][0]+each[2]
|
||||
|
||||
@@ -74,21 +75,21 @@ for each in ActiveUser:
|
||||
ws = wb.add_sheet('Addresses')
|
||||
|
||||
# Write header row
|
||||
ws.write(0,0,'ACTION')
|
||||
ws.write(0,1,'BU_ID')
|
||||
ws.write(0,2,'LOGIN_ID')
|
||||
ws.write(0,3,'PA_NAME')
|
||||
ws.write(0,4, 'PA_NAME2')
|
||||
ws.write(0,5,'LINE1')
|
||||
ws.write(0,6,'LINE2')
|
||||
ws.write(0,7,'LINE3')
|
||||
ws.write(0,8,'CITY')
|
||||
ws.write(0,9,'STATE')
|
||||
ws.write(0,10,'ZIP')
|
||||
ws.write(0,11,'COUNTRY')
|
||||
ws.write(0,12,'PHONE_NR')
|
||||
ws.write(0,13,'SHIP_TO_ATTN_TX')
|
||||
ws.write(0,14, 'PROFILE_TYPE')
|
||||
ws.write(0, 0, 'ACTION')
|
||||
ws.write(0, 1, 'BU_ID')
|
||||
ws.write(0, 2, 'LOGIN_ID')
|
||||
ws.write(0, 3, 'PA_NAME')
|
||||
ws.write(0, 4, 'PA_NAME2')
|
||||
ws.write(0, 5, 'LINE1')
|
||||
ws.write(0, 6, 'LINE2')
|
||||
ws.write(0, 7, 'LINE3')
|
||||
ws.write(0, 8, 'CITY')
|
||||
ws.write(0, 9, 'STATE')
|
||||
ws.write(0, 10, 'ZIP')
|
||||
ws.write(0, 11, 'COUNTRY')
|
||||
ws.write(0, 12, 'PHONE_NR')
|
||||
ws.write(0, 13, 'SHIP_TO_ATTN_TX')
|
||||
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.
|
||||
@@ -102,7 +103,6 @@ for each in ActiveUser:
|
||||
# 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
|
||||
# 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, 3, AddresssBookLine[1])
|
||||
ws.write(LineCount, 5, AddresssBookLine[2])
|
||||
|
||||
Reference in New Issue
Block a user