"""Fuel object class.

This is used in a number of modules, including rtlib.py and pwall.py.

"""

class FuelObject(object):
    """A Fuel object describes a real-world things like a file or process.

    It has a nice repr() similar to FuelStruct, but with the 'host'
    attribute specifically excluded.

    """

    def __repr__(self):
        d = self.__dict__
        keys = [key for key in d if key != "host" and not key.startswith("_")]
        keys.sort()
        L = []
        for key in keys:
            L.append("%s=%r" % (key, d[key]))
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

