commit 6baddc626d1e0cc70dfced64286ab7ed84903981
parent 6015c72db40495105d876d869f6951fbd4cb6ee7
Author: Árni Dagur <agudmundsson@fc-md.umd.edu>
Date: Fri, 10 Apr 2020 15:14:06 -0400
Add __repr__ for HostnameSpecificResources
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/lib.rs b/src/lib.rs
@@ -151,6 +151,19 @@ impl Into<HostnameSpecificResources> for RustHostnameSpecificResources {
}
}
+#[pyproto]
+impl PyObjectProtocol for HostnameSpecificResources {
+ fn __repr__(&self) -> PyResult<String> {
+ Ok(format!(
+ "HostnameSpecificResources<{} hide selectors, {} style selectors, {} exceptions, injected_javascript={:?}>",
+ self.hide_selectors.len(),
+ self.style_selectors.len(),
+ self.exceptions.len(),
+ self.injected_script,
+ ))
+ }
+}
+
#[pyclass]
pub struct Engine {
engine: RustEngine,