logging
This commit is contained in:
@@ -15,7 +15,7 @@ dictionary = {}
|
|||||||
def add_dict(id, key, value):
|
def add_dict(id, key, value):
|
||||||
dict = dictionary.get(id)
|
dict = dictionary.get(id)
|
||||||
if key in dict:
|
if key in dict:
|
||||||
print("increasing dict key for: ",value,"key IS: ",key)
|
print("increasing notsms dict key for: ",value,"key IS: ",key)
|
||||||
dict[key] += value
|
dict[key] += value
|
||||||
|
|
||||||
print("end state: ",dict[key])
|
print("end state: ",dict[key])
|
||||||
@@ -26,10 +26,10 @@ def add_dict(id, key, value):
|
|||||||
else:
|
else:
|
||||||
print("Never should happen", id)
|
print("Never should happen", id)
|
||||||
|
|
||||||
def add_dict2(id, pricesms):
|
def add_dictsms(id, pricesms):
|
||||||
dict = dictionary.get(id)
|
dict = dictionary.get(id)
|
||||||
|
|
||||||
print("increasing dict key for: ",pricesms)
|
print("increasing sms dict key for dict: ",dict," for :",pricesms)
|
||||||
dict["smscount"] += pricesms
|
dict["smscount"] += pricesms
|
||||||
|
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ with open(FILE, newline='', encoding='utf-8') as csvfile:
|
|||||||
price = float(row['CHARGE_NET'].replace(',','.'))
|
price = float(row['CHARGE_NET'].replace(',','.'))
|
||||||
|
|
||||||
price = round(price, 5)
|
price = round(price, 5)
|
||||||
|
print("before conditions price: ",price)
|
||||||
|
|
||||||
typ = None
|
typ = None
|
||||||
if row['CHARGE_TYPE'] == "Pravidelné měsíční poplatky":
|
if row['CHARGE_TYPE'] == "Pravidelné měsíční poplatky":
|
||||||
@@ -98,15 +98,17 @@ with open(FILE, newline='', encoding='utf-8') as csvfile:
|
|||||||
|
|
||||||
#only if not exist create new record in dictionary for ID
|
#only if not exist create new record in dictionary for ID
|
||||||
if not MSISDN in dictionary:
|
if not MSISDN in dictionary:
|
||||||
|
|
||||||
dictionary[MSISDN] = {'ICCID':ICCID,'data':0.00000, 'sms':0.00000, 'other':0.00000, 'smscount':pricesms}
|
dictionary[MSISDN] = {'ICCID':ICCID,'data':0.00000, 'sms':0.00000, 'other':0.00000, 'smscount':pricesms}
|
||||||
|
print("Creating new dictionary: ", dictionary[MSISDN])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Adding: ",price," for: ", dictionary[MSISDN], "TYP: ",typ)
|
print("Adding: ", price, " for: ", dictionary[MSISDN], "TYP: ",typ)
|
||||||
|
add_dict(MSISDN, typ, price)
|
||||||
if row['INCREMENT'] == "SMS":
|
if row['INCREMENT'] == "SMS":
|
||||||
print("pricesms: ",pricesms," for unit: ",dictionary[MSISDN])
|
print("pricesms: ",pricesms," for unit: ",dictionary[MSISDN])
|
||||||
add_dict2(MSISDN, pricesms)
|
add_dictsms(MSISDN, pricesms)
|
||||||
add_dict(MSISDN, typ, price)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user