Commit 3344c026 authored by Antoine Millet's avatar Antoine Millet
Browse files

Export method of jobs now have an props argument to filter exported job properties.

parent 7dbf22ba
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -132,14 +132,14 @@ class BaseJob(dict, Thread, object):
        self['done'] = True
        self['status'] = 'cancelling'

    def export(self):
    def export(self, props=None):
        '''
        Export the job in a simple dict format.
        '''

        exported = {}
        for key, val in self.iteritems():
            if key.startswith('_'):
            if key.startswith('_') or (props is not None and key in props):
                continue
            if isinstance(val, datetime):
                now = datetime.now()