mirror of https://gitlab.com/bashrc2/epicyon
Item quantity as float
parent
5c9d61f68e
commit
ec6820dd9a
|
@ -13821,8 +13821,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.domain)
|
self.server.domain)
|
||||||
itemQty = 1
|
itemQty = 1
|
||||||
if fields['itemQty']:
|
if fields['itemQty']:
|
||||||
if fields['itemQty'].isdigit():
|
if isfloat(fields['itemQty']):
|
||||||
itemQty = int(fields['itemQty'])
|
itemQty = float(fields['itemQty'])
|
||||||
itemPrice = "0.00"
|
itemPrice = "0.00"
|
||||||
if fields['itemPrice']:
|
if fields['itemPrice']:
|
||||||
if isfloat(fields['itemPrice']):
|
if isfloat(fields['itemPrice']):
|
||||||
|
|
|
@ -562,7 +562,7 @@ parser.add_argument('--summary', dest='summary', type=str,
|
||||||
parser.add_argument('--itemImage', dest='itemImage', type=str,
|
parser.add_argument('--itemImage', dest='itemImage', type=str,
|
||||||
default=None,
|
default=None,
|
||||||
help='Filename of an image for an item being shared')
|
help='Filename of an image for an item being shared')
|
||||||
parser.add_argument('--itemQty', dest='itemQty', type=int,
|
parser.add_argument('--itemQty', dest='itemQty', type=float,
|
||||||
default=1,
|
default=1,
|
||||||
help='Quantity of items being shared')
|
help='Quantity of items being shared')
|
||||||
parser.add_argument('--itemPrice', dest='itemPrice', type=str,
|
parser.add_argument('--itemPrice', dest='itemPrice', type=str,
|
||||||
|
|
16
shares.py
16
shares.py
|
@ -235,7 +235,7 @@ def _indicateNewShareAvailable(baseDir: str, httpPrefix: str,
|
||||||
def addShare(baseDir: str,
|
def addShare(baseDir: str,
|
||||||
httpPrefix: str, nickname: str, domain: str, port: int,
|
httpPrefix: str, nickname: str, domain: str, port: int,
|
||||||
displayName: str, summary: str, imageFilename: str,
|
displayName: str, summary: str, imageFilename: str,
|
||||||
itemQty: int, itemType: str, itemCategory: str, location: str,
|
itemQty: float, itemType: str, itemCategory: str, location: str,
|
||||||
duration: str, debug: bool, city: str,
|
duration: str, debug: bool, city: str,
|
||||||
price: str, currency: str,
|
price: str, currency: str,
|
||||||
systemLanguage: str, translate: {}) -> None:
|
systemLanguage: str, translate: {}) -> None:
|
||||||
|
@ -295,7 +295,7 @@ def addShare(baseDir: str,
|
||||||
"displayName": displayName,
|
"displayName": displayName,
|
||||||
"summary": summary,
|
"summary": summary,
|
||||||
"imageUrl": imageUrl,
|
"imageUrl": imageUrl,
|
||||||
"itemQty": itemQty,
|
"itemQty": float(itemQty),
|
||||||
"dfcId": dfcId,
|
"dfcId": dfcId,
|
||||||
"itemType": itemType,
|
"itemType": itemType,
|
||||||
"category": itemCategory,
|
"category": itemCategory,
|
||||||
|
@ -457,7 +457,7 @@ def sendShareViaServer(baseDir, session,
|
||||||
fromDomain: str, fromPort: int,
|
fromDomain: str, fromPort: int,
|
||||||
httpPrefix: str, displayName: str,
|
httpPrefix: str, displayName: str,
|
||||||
summary: str, imageFilename: str,
|
summary: str, imageFilename: str,
|
||||||
itemQty: int, itemType: str, itemCategory: str,
|
itemQty: float, itemType: str, itemCategory: str,
|
||||||
location: str, duration: str,
|
location: str, duration: str,
|
||||||
cachedWebfingers: {}, personCache: {},
|
cachedWebfingers: {}, personCache: {},
|
||||||
debug: bool, projectVersion: str,
|
debug: bool, projectVersion: str,
|
||||||
|
@ -484,7 +484,7 @@ def sendShareViaServer(baseDir, session,
|
||||||
"type": "Offer",
|
"type": "Offer",
|
||||||
"displayName": displayName,
|
"displayName": displayName,
|
||||||
"summary": summary,
|
"summary": summary,
|
||||||
"itemQty": itemQty,
|
"itemQty": float(itemQty),
|
||||||
"itemType": itemType,
|
"itemType": itemType,
|
||||||
"category": itemCategory,
|
"category": itemCategory,
|
||||||
"location": location,
|
"location": location,
|
||||||
|
@ -711,7 +711,7 @@ def outboxShareUpload(baseDir: str, httpPrefix: str,
|
||||||
messageJson['object']['displayName'],
|
messageJson['object']['displayName'],
|
||||||
messageJson['object']['summary'],
|
messageJson['object']['summary'],
|
||||||
messageJson['object']['imageFilename'],
|
messageJson['object']['imageFilename'],
|
||||||
messageJson['object']['itemQty'],
|
float(messageJson['object']['itemQty']),
|
||||||
messageJson['object']['itemType'],
|
messageJson['object']['itemType'],
|
||||||
messageJson['object']['itemCategory'],
|
messageJson['object']['itemCategory'],
|
||||||
messageJson['object']['location'],
|
messageJson['object']['location'],
|
||||||
|
@ -855,7 +855,7 @@ def sharesCatalogAccountEndpoint(baseDir: str, httpPrefix: str,
|
||||||
"DFC:hasType": dfcId,
|
"DFC:hasType": dfcId,
|
||||||
"DFC:startDate": item['published'],
|
"DFC:startDate": item['published'],
|
||||||
"DFC:expiryDate": expireDateStr,
|
"DFC:expiryDate": expireDateStr,
|
||||||
"DFC:quantity": item['itemQty'],
|
"DFC:quantity": float(item['itemQty']),
|
||||||
"DFC:price": priceStr,
|
"DFC:price": priceStr,
|
||||||
"DFC:Image": item['imageUrl'],
|
"DFC:Image": item['imageUrl'],
|
||||||
"DFC:description": description
|
"DFC:description": description
|
||||||
|
@ -940,7 +940,7 @@ def sharesCatalogEndpoint(baseDir: str, httpPrefix: str,
|
||||||
"DFC:hasType": dfcId,
|
"DFC:hasType": dfcId,
|
||||||
"DFC:startDate": startDateStr,
|
"DFC:startDate": startDateStr,
|
||||||
"DFC:expiryDate": expireDateStr,
|
"DFC:expiryDate": expireDateStr,
|
||||||
"DFC:quantity": item['itemQty'],
|
"DFC:quantity": float(item['itemQty']),
|
||||||
"DFC:price": priceStr,
|
"DFC:price": priceStr,
|
||||||
"DFC:Image": item['imageUrl'],
|
"DFC:Image": item['imageUrl'],
|
||||||
"DFC:description": description
|
"DFC:description": description
|
||||||
|
@ -1307,7 +1307,7 @@ def _dfcToSharesFormat(catalogJson: {},
|
||||||
"displayName": item['DFC:description'].split(':')[0],
|
"displayName": item['DFC:description'].split(':')[0],
|
||||||
"summary": description,
|
"summary": description,
|
||||||
"imageUrl": item['DFC:Image'],
|
"imageUrl": item['DFC:Image'],
|
||||||
"itemQty": item['DFC:quantity'],
|
"itemQty": float(item['DFC:quantity']),
|
||||||
"dfcId": dfcId,
|
"dfcId": dfcId,
|
||||||
"itemType": itemType,
|
"itemType": itemType,
|
||||||
"category": itemCategory,
|
"category": itemCategory,
|
||||||
|
|
Loading…
Reference in New Issue