Stores username and password, provides access to invent. More...
Public Member Functions | |
def | __init__ |
def | add_attachment |
Adds attachment to component. | |
def | addItemReference |
Add reference to an item. | |
def | check_assembled |
Verifies that component is assembled and parts have passed Qual. | |
def | check_serial_valid |
Check invent DB for serial, make sure it is valid. | |
def | delete_attachment |
Deletes attachment. | |
def | delete_note |
Delete note for item. | |
def | deleteKV |
Delete key value for component. | |
def | generateWGMacaddr |
Generates Willow Garage mac address for item. | |
def | get_attachment |
Get attachment. | |
def | get_attachment_info |
Get attachment info. | |
def | get_item_notes |
Gets notes for an item. | |
def | get_item_references |
Return any references to an item. | |
def | get_note |
Get information about note. | |
def | get_parent_item |
Returns parent item (serial number) or location. | |
def | get_sub_items |
Returns list of sub items (references) for a particular parent. | |
def | get_test_status |
Returns True if part has 'Test Status'='PASS', False otherwise. | |
def | getItemReferences |
def | getKV |
Return value of component's key Get key-value of component. | |
def | list_attachments |
List all attachments for an item. | |
def | listKVs |
List Key-Value pairs of component. | |
def | login |
Logs into Invent. | |
def | lookup_by_reference |
Lookup item by a reference. | |
def | reload_pr2scds_bom |
Reload BoM from PR2 SCDS. | |
def | remove_item_reference |
Remove reference from item. | |
def | restore_note |
Restore (un-delete) note for item. | |
def | setKV |
Set value of component's key. | |
def | setNote |
Sets notes of component Sets a note value for the component. | |
Public Attributes | |
cj | |
debug | |
loggedin | |
opener | |
password | |
site | |
username | |
Private Member Functions | |
def | _login |
Login to inventory system with given username and password Returns True if successful, False if failure. | |
Private Attributes | |
_logged_time |
Stores username and password, provides access to invent.
Performs all action relating to inventory system Will login automatically before all functions if needed
Definition at line 65 of file invent_client.py.
def wg_invent_client.invent_client.Invent.__init__ | ( | self, | |
username, | |||
password, | |||
debug = False |
|||
) |
username | str : Username for WG invent system |
password | str : Password for WG invent system |
Definition at line 68 of file invent_client.py.
def wg_invent_client.invent_client.Invent._login | ( | self | ) | [private] |
Login to inventory system with given username and password Returns True if successful, False if failure.
Definition at line 93 of file invent_client.py.
def wg_invent_client.invent_client.Invent.add_attachment | ( | self, | |
reference, | |||
name, | |||
mimetype, | |||
attachment, | |||
note = None , |
|||
aid = None |
|||
) |
Adds attachment to component.
Adds file as attachment to component. Attachment it encoded to unicode, then uploaded. Mimetype is optional, but helps users view attachments in window.
reference | str : Serial number of component |
name | str : Attachment filename |
mimetype | MIMEType : MIMEType of file |
attachment | any : Attachment data |
note | str : Note to add with attachment (description) |
aid | str : Attachment ID. If set, attempts to overwrite attachment at ID |
Definition at line 580 of file invent_client.py.
def wg_invent_client.invent_client.Invent.addItemReference | ( | self, | |
key, | |||
name, | |||
reference | |||
) |
Add reference to an item.
key | str : Serial number of item |
name | str : Reference name |
reference | str : Reference value |
Definition at line 284 of file invent_client.py.
def wg_invent_client.invent_client.Invent.check_assembled | ( | self, | |
serial, | |||
recursive = False |
|||
) |
Verifies that component is assembled and parts have passed Qual.
Checks that part is assembled against BoM. All sub-parts must be properly associated to the parent part. All sub-parts must have passed qualification.
serial | str : Serial number to check |
recursive | bool : Check all sub-assemblies for assembly |
Definition at line 159 of file invent_client.py.
def wg_invent_client.invent_client.Invent.check_serial_valid | ( | self, | |
serial | |||
) |
Check invent DB for serial, make sure it is valid.
Definition at line 135 of file invent_client.py.
def wg_invent_client.invent_client.Invent.delete_attachment | ( | self, | |
aid | |||
) |
Deletes attachment.
Hard delete.
Returns true if attachment is deleted, or not found.
aid | str : Attachment ID |
Definition at line 703 of file invent_client.py.
def wg_invent_client.invent_client.Invent.delete_note | ( | self, | |
noteid | |||
) |
Delete note for item.
Soft-delete only. Will return True if note has already been deleted
noteid | str : Note to delete |
Definition at line 380 of file invent_client.py.
def wg_invent_client.invent_client.Invent.deleteKV | ( | self, | |
reference, | |||
key | |||
) |
Delete key value for component.
Delete key-value of component.
reference | str : Serial number of component |
key | str : Key (name) |
Definition at line 488 of file invent_client.py.
def wg_invent_client.invent_client.Invent.generateWGMacaddr | ( | self, | |
key, | |||
name | |||
) |
Generates Willow Garage mac address for item.
Used for forearm cameras Does not return mac address
key | str : Serial number of item |
name | str : Interface name (ex: "lan0") |
Definition at line 311 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_attachment | ( | self, | |
aid | |||
) |
Get attachment.
aid | str : Attachment ID |
Definition at line 671 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_attachment_info | ( | self, | |
aid | |||
) |
Get attachment info.
aid | str : Attachment ID |
Definition at line 642 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_item_notes | ( | self, | |
reference, | |||
deleted = False |
|||
) |
Gets notes for an item.
reference | str : Serial number to check |
deleted | bool : Retrieve deleted notes in addition to non-deleted notes |
Definition at line 351 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_item_references | ( | self, | |
key | |||
) |
Return any references to an item.
References are grouped by name, and are stored as NAME:REFERENCE,... under each item.
key | str : Serial number of item |
Definition at line 228 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_note | ( | self, | |
noteid | |||
) |
Get information about note.
Returns tuple of note information as strings. Reference is serial number. Date is UTC format. "deleted" is "1" for deleted, "0" if not.
noteid | str : Note ID |
Definition at line 429 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_parent_item | ( | self, | |
reference | |||
) |
Returns parent item (serial number) or location.
Parent may be a location, such as "Recieving", instead of a serial number.
reference | str : Serial number to check |
Definition at line 759 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_sub_items | ( | self, | |
reference, | |||
recursive = False |
|||
) |
Returns list of sub items (references) for a particular parent.
In debug mode, Invent can return list of sub parts recursively
reference | str : WG PN of component or assembly |
recursive | bool [optional] : Sub-sub-...-sub-parts of reference |
Definition at line 728 of file invent_client.py.
def wg_invent_client.invent_client.Invent.get_test_status | ( | self, | |
reference | |||
) |
Returns True if part has 'Test Status'='PASS', False otherwise.
Definition at line 515 of file invent_client.py.
def wg_invent_client.invent_client.Invent.getItemReferences | ( | self, | |
key | |||
) |
Definition at line 219 of file invent_client.py.
def wg_invent_client.invent_client.Invent.getKV | ( | self, | |
reference, | |||
key | |||
) |
Return value of component's key Get key-value of component.
Ex: 'PASS' = getKV(my_ref, 'Test Status')
reference | str : Serial number of component |
key | str : Key (name) |
Definition at line 523 of file invent_client.py.
def wg_invent_client.invent_client.Invent.list_attachments | ( | self, | |
key | |||
) |
List all attachments for an item.
Definition at line 615 of file invent_client.py.
def wg_invent_client.invent_client.Invent.listKVs | ( | self, | |
reference | |||
) |
List Key-Value pairs of component.
reference | str : Serial number of component |
Definition at line 546 of file invent_client.py.
def wg_invent_client.invent_client.Invent.login | ( | self | ) |
def wg_invent_client.invent_client.Invent.lookup_by_reference | ( | self, | |
ref | |||
) |
Lookup item by a reference.
Item references are stored as key-values. Ex: { "wan0", "005a86000000" } This returns all items associated with a given reference value.
str | : Reference to lookup |
Definition at line 198 of file invent_client.py.
Reload BoM from PR2 SCDS.
Loads barcode association tables
Definition at line 114 of file invent_client.py.
def wg_invent_client.invent_client.Invent.remove_item_reference | ( | self, | |
key, | |||
name | |||
) |
Remove reference from item.
key | str : Serial number of item |
name | str : Reference name |
Definition at line 256 of file invent_client.py.
def wg_invent_client.invent_client.Invent.restore_note | ( | self, | |
noteid | |||
) |
Restore (un-delete) note for item.
Will return True if note has already been restored
noteid | str : Note to delete |
Definition at line 404 of file invent_client.py.
def wg_invent_client.invent_client.Invent.setKV | ( | self, | |
reference, | |||
key, | |||
value | |||
) |
Set value of component's key.
Set key-value of component. Ex: setKV(my_ref, 'Test Status', 'PASS')
reference | str : Serial number of component |
key | str : Key (name) |
value | str : Value |
Definition at line 460 of file invent_client.py.
def wg_invent_client.invent_client.Invent.setNote | ( | self, | |
reference, | |||
note, | |||
noteid = None |
|||
) |
Sets notes of component Sets a note value for the component.
Allows users to set the text of a particular note if the noteid parameter is specified. Returns noteid to allow note edits. Returns None if error.
reference | str : Serial number of item |
note | str : Text of item |
noteid | int (optional) : Note ID, allows programmatic access to note text |
Definition at line 328 of file invent_client.py.
Definition at line 68 of file invent_client.py.
Definition at line 68 of file invent_client.py.
Definition at line 68 of file invent_client.py.
Definition at line 68 of file invent_client.py.
Definition at line 68 of file invent_client.py.
Definition at line 68 of file invent_client.py.
Definition at line 68 of file invent_client.py.
Definition at line 68 of file invent_client.py.