Broke report appending into a separate function/file. Started working on Column Format Checking Function
This commit is contained in:
@@ -2,11 +2,82 @@ from bs4 import BeautifulSoup as bs
|
||||
# import csv
|
||||
from openpyxl import workbook
|
||||
|
||||
external_ids = ['G-ADA-13B0D9D1', 'G-ADA-13A8D9CF', 'G-ADA-13B0D9CF', 'G-ADA-13B0D9CE', 'G-ADA-13A7D9D5', 'G-ADA-13ACD9D5', 'G-ADA-13B2D9D5', 'G-ADA-13AED9D4', 'G-ADA-13B1D9D4', 'G-ADA-13ACD9D3', 'G-ADA-13B1D9D3', 'G-ADA-13AED9D2', 'G-ADA-9F17D9CB', 'G-ADA-9F15D9CB', 'G-ADA']
|
||||
|
||||
for z in external_ids:
|
||||
report_filter = """<?xml version="1.0"?> <PFWebFilter:UserFilter xmlns:PFWebFilter="http://www.pageflex.com/schemas/2004/Storefront/UserFilters/20040817" filterClass="Items"> <PFWebFilter:Step publicFieldName="Order ID" query="ExactEquals" minValue=""""" + z + """"" maxValue="" /> </PFWebFilter:UserFilter>"""
|
||||
print(report_filter)
|
||||
|
||||
###REPORT ColumnFormat TESTING#####
|
||||
|
||||
with open("StorefrontUtilitiesConfig.xml") as f:
|
||||
r = f.read()
|
||||
|
||||
y = bs(r, "lxml")
|
||||
|
||||
ClientName = []
|
||||
SF_URL = []
|
||||
SF_HOST = []
|
||||
CLIENT_SUMMARY_TAB = []
|
||||
SUMMARY_TAB = []
|
||||
client_headers = []
|
||||
headers = []
|
||||
|
||||
CLIENT_COLUMN_FORMAT = []
|
||||
COLUMN_FORMAT = []
|
||||
|
||||
for x in y.find_all('name'):
|
||||
# print(x.text)
|
||||
ClientName.append(x.text)
|
||||
# print(ClientName)
|
||||
|
||||
for w in y.find_all('client'):
|
||||
for x in w.find_all('monthlyreport'):
|
||||
for g in x.find_all('summarytab'):
|
||||
for z in g.find_all('columnname'):
|
||||
z.name = "string"
|
||||
CLIENT_SUMMARY_TAB.append(z)
|
||||
client_headers.append(z.text)
|
||||
SUMMARY_TAB.append(CLIENT_SUMMARY_TAB)
|
||||
headers.append(client_headers)
|
||||
CLIENT_SUMMARY_TAB = []
|
||||
client_headers = []
|
||||
|
||||
|
||||
for w in y.find_all('client'):
|
||||
for x in w.find_all('monthlyreport'):
|
||||
for g in x.find_all('summarytab'):
|
||||
for z in g.find_all('columnformat'):
|
||||
CLIENT_COLUMN_FORMAT.append(z.text)
|
||||
COLUMN_FORMAT.append(CLIENT_COLUMN_FORMAT)
|
||||
CLIENT_COLUMN_FORMAT = []
|
||||
|
||||
|
||||
option = 0
|
||||
columnformat = dict.fromkeys(headers[option])
|
||||
|
||||
|
||||
for w in y.find_all('client'):
|
||||
for x in w.find_all('name'):
|
||||
if x.text == ClientName[option]:
|
||||
for x in w.find_all('monthlyreport'):
|
||||
for g in x.find_all('summarytab'):
|
||||
for z in g.find_all('columnformat'):
|
||||
CLIENT_COLUMN_FORMAT.append(z.text)
|
||||
|
||||
count = 0
|
||||
|
||||
|
||||
# print(columnformat)
|
||||
for key in columnformat:
|
||||
columnformat[key] = CLIENT_COLUMN_FORMAT[count]
|
||||
count = count + 1
|
||||
print(columnformat)
|
||||
|
||||
|
||||
|
||||
|
||||
# external_ids = ['G-ADA-13B0D9D1', 'G-ADA-13A8D9CF']
|
||||
#
|
||||
# for z in external_ids:
|
||||
# report_filter = """<?xml version="1.0"?> <PFWebFilter:UserFilter xmlns:PFWebFilter="http://www.pageflex.com/schemas/2004/Storefront/UserFilters/20040817" filterClass="Items"> <PFWebFilter:Step publicFieldName="Order ID" query="ExactEquals" minValue=""""" + z + """"" maxValue="" /> </PFWebFilter:UserFilter>"""
|
||||
# print(report_filter)
|
||||
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user