MCPcopy Create free account
hub / github.com/arvidn/libtorrent / make_dict

Function make_dict

bindings/python/src/session.cpp:161–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159 }
160
161 dict make_dict(lt::settings_pack const& sett)
162 {
163 dict ret;
164 for (int i = settings_pack::string_type_base;
165 i < settings_pack::max_string_setting_internal; ++i)
166 {
167 // deprecated settings are still here, they just have empty names
168 char const* name = name_for_setting(i);
169 if (name[0] != '\0' && sett.has_val(i)) ret[name] = sett.get_str(i);
170 }
171
172 for (int i = settings_pack::int_type_base;
173 i < settings_pack::max_int_setting_internal; ++i)
174 {
175 char const* name = name_for_setting(i);
176 if (name[0] != '\0' && sett.has_val(i)) ret[name] = sett.get_int(i);
177 }
178
179 for (int i = settings_pack::bool_type_base;
180 i < settings_pack::max_bool_setting_internal; ++i)
181 {
182 char const* name = name_for_setting(i);
183 if (name[0] != '\0' && sett.has_val(i)) ret[name] = sett.get_bool(i);
184 }
185 return ret;
186 }
187
188 std::shared_ptr<lt::session> make_session(boost::python::dict sett
189 , session_flags_t const flags)

Callers 5

session_get_settingsFunction · 0.85
min_memory_usage_wrapperFunction · 0.85
default_settings_wrapperFunction · 0.85
convertMethod · 0.85

Calls 4

name_for_settingFunction · 0.85
has_valMethod · 0.80
get_intMethod · 0.80
get_boolMethod · 0.80

Tested by

no test coverage detected