Beispiel #1
0
 def __repr__(self):
     """Generate a string representation."""
     return generate_string_from_data(
         self,
         skip=["passphrase"],
         add={"passphrase_set": bool(self.passphrase)}
     )
Beispiel #2
0
    def __repr__(self):
        """Describe the user for easy debugging.

        As there are many fields many of which might not be set,
        we only try to list the values that are set.

        :return: a string describing the UserData instance
        :rtype: str
        """
        return generate_string_from_data(
            self, skip=["password"], add={"password_set": bool(self.password)})
 def __repr__(self):
     return generate_string_from_data(
         obj=self,
         skip=["b"],
         add=["b_is_set={}".format(bool(self.b))]
     )
Beispiel #4
0
    def generate_string_from_invalid_type_test(self):
        with self.assertRaises(DBusStructureError) as cm:
            generate_string_from_data({"x": 1})

        self.assertEqual(str(cm.exception), "Fields are not defined at '__dbus_fields__'.")
Beispiel #5
0
 def __repr__(self):
     return generate_string_from_data(
         obj=self,
         skip=["b"],
         add={"b_is_set": bool(self.b)}
     )
Beispiel #6
0
 def __repr__(self):
     return generate_string_from_data(
         obj=self, skip=["b"], add=["b_is_set={}".format(bool(self.b))])