def get_inventory_for_display(full_name): """ Get inventory description full_name -- fully qualified name, in form db.coll """ try: inv.setup_internal_client() db = inv.int_client[inv.ALL_STRUC.name] except Exception as e: raise ih.ConnectOrAuthFail("") return None try: parts = ih.get_description_key_parts(full_name) records = retrieve_description(db, parts[0], parts[1]) except Exception as e: inv.log_dest.error("Unable to get requested inventory " + str(e)) return {'data': None, 'specials': None, 'scrape_date': None} try: return { 'data': ih.escape_for_display(records['data']), 'specials': ih.escape_for_display(records['specials']), 'scrape_date': records['scrape_date'] } except Exception as e: inv.log_dest.error("Error decoding inventory object " + str(e)) return {'data': None, 'specials': None, 'scrape_date': None}
def get_inventory_for_display(table_name): """ Get inventory description """ try: records = retrieve_description(table_name) except Exception as e: inv.log_dest.error("Unable to get requested inventory "+ str(e)) return {'data': None, 'specials': None, 'scrape_date': None} try: return {'data':ih.escape_for_display(records['data']), 'specials':ih.escape_for_display(records['specials']), 'scrape_date':records['scrape_date']} except Exception as e: inv.log_dest.error("Error decoding inventory object "+ str(e)) return {'data': None, 'specials': None, 'scrape_date': None}
def get_inventory_for_display(full_name): """ Get inventory description full_name -- fully qualified name, in form db.coll """ try: parts = ih.get_description_key_parts(full_name) records = retrieve_description(parts[0], parts[1]) except: return {'data': None, 'specials': None, 'scrape_date': None} try: return {'data':ih.escape_for_display(records['data']), 'specials':ih.escape_for_display(records['specials']), 'scrape_date':records['scrape_date']} except: return {'data': None, 'specials': None, 'scrape_date': None}
def get_inventory_for_display(full_name): """ Get inventory description full_name -- fully qualified name, in form db.coll """ try: inv.setup_internal_client() db = inv.int_client[inv.ALL_STRUC.name] except Exception as e: raise ih.ConnectOrAuthFail("") return None try: parts = ih.get_description_key_parts(full_name) records = retrieve_description(db, parts[0], parts[1]) except Exception as e: inv.log_dest.error("Unable to get requested inventory "+ str(e)) return {'data': None, 'specials': None, 'scrape_date': None} try: return {'data':ih.escape_for_display(records['data']), 'specials':ih.escape_for_display(records['specials']), 'scrape_date':records['scrape_date']} except Exception as e: inv.log_dest.error("Error decoding inventory object "+ str(e)) return {'data': None, 'specials': None, 'scrape_date': None}