MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / add_data

Function add_data

tools/python-3.11.9-amd64/Lib/msilib/__init__.py:102–126  ·  view source on GitHub ↗
(db, table, values)

Source from the content-addressed store, hash-verified

100 raise ValueError("Action not found in sequence")
101
102def add_data(db, table, values):
103 v = db.OpenView("SELECT * FROM `%s`" % table)
104 count = v.GetColumnInfo(MSICOLINFO_NAMES).GetFieldCount()
105 r = CreateRecord(count)
106 for value in values:
107 assert len(value) == count, value
108 for i in range(count):
109 field = value[i]
110 if isinstance(field, int):
111 r.SetInteger(i+1,field)
112 elif isinstance(field, str):
113 r.SetString(i+1,field)
114 elif field is None:
115 pass
116 elif isinstance(field, Binary):
117 r.SetStream(i+1, field.name)
118 else:
119 raise TypeError("Unsupported type %s" % field.__class__.__name__)
120 try:
121 v.Modify(MSIMODIFY_INSERT, r)
122 except Exception:
123 raise MSIError("Could not insert "+repr(values)+" into "+table)
124
125 r.ClearData()
126 v.Close()
127
128
129def add_stream(db, name, path):

Callers 15

init_databaseFunction · 0.85
add_tablesFunction · 0.85
commitMethod · 0.85
__init__Method · 0.85
start_componentMethod · 0.85
add_fileMethod · 0.85
remove_pycMethod · 0.85
__init__Method · 0.85
eventMethod · 0.85
mappingMethod · 0.85
conditionMethod · 0.85
addMethod · 0.85

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected