MCPcopy Create free account
hub / github.com/HexHive/NASS / insert_interface

Function insert_interface

data/interface_db.py:142–158  ·  view source on GitHub ↗
(connection, service_id, interface:Cmd)

Source from the content-addressed store, hash-verified

140 print(f'[BINDERDB] Failed retrieving interface {str(e)}, {traceback.format_exc()}')
141
142def insert_interface(connection, service_id, interface:Cmd):
143 try:
144 cursor = connection.cursor()
145 insert_query = """
146 INSERT INTO interface (service_id, cmd_id, valid, args_enumerated)
147 VALUES (?,?,?,?)
148 """
149 cursor.execute(insert_query, (service_id, interface.cmd_id, int(interface.valid), int(interface.args_enumerated)))
150 connection.commit()
151 interface_id = cursor.lastrowid
152 cursor.close()
153 for i, arg in enumerate(interface.args):
154 insert_arg(connection, interface_id, arg, i)
155 return interface_id
156 except Exception as e:
157 logging.error(f'[BINDERDB] Failed inserting interface {str(e)}, {traceback.format_exc()}')
158 print(f'[BINDERDB] Failed inserting interface {str(e)}, {traceback.format_exc()}')
159
160def insert_update_interface(connection, service_id, interface:Cmd):
161 try:

Callers 2

insert_update_interfaceFunction · 0.85
insert_serviceFunction · 0.85

Calls 2

insert_argFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected