How to use the gkeepapi.node.NodeTimestamps.int_to_dt function in gkeepapi

To help you get started, we’ve selected a few gkeepapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kiwiz / gkeepapi / test / test_nodes.py View on Github external
def test_delete(self):
        n = TestElement()
        n.delete()

        self.assertTrue(n.timestamps.dirty)
        self.assertTrue(n.timestamps.deleted > node.NodeTimestamps.int_to_dt(0))
github kiwiz / gkeepapi / test / test_nodes.py View on Github external
def test_trashed(self):
        n = TestElement()
        self.assertFalse(n.trashed)

        n.timestamps.trashed = None
        self.assertFalse(n.trashed)

        n.timestamps.trashed = node.NodeTimestamps.int_to_dt(0)
        self.assertFalse(n.trashed)

        n.timestamps.trashed = node.NodeTimestamps.int_to_dt(1)
        self.assertTrue(n.trashed)
github kiwiz / gkeepapi / test / test_nodes.py View on Github external
def test_deleted(self):
        n = TestElement()
        self.assertFalse(n.deleted)

        n.timestamps.deleted = None
        self.assertFalse(n.deleted)

        n.timestamps.deleted = node.NodeTimestamps.int_to_dt(0)
        self.assertFalse(n.deleted)

        n.timestamps.deleted = node.NodeTimestamps.int_to_dt(1)
        self.assertTrue(n.deleted)
github kiwiz / gkeepapi / gkeepapi / node.py View on Github external
def __init__(self):
        super(Label, self).__init__()

        create_time = time.time()

        self.id = self._generateId(create_time)
        self._name = ''
        self.timestamps = NodeTimestamps(create_time)
        self._merged = NodeTimestamps.int_to_dt(0)
github kiwiz / gkeepapi / gkeepapi / node.py View on Github external
def trashed(self):
        return self.timestamps.trashed > NodeTimestamps.int_to_dt(0)
github kiwiz / gkeepapi / gkeepapi / node.py View on Github external
def trashed(self, value):
        self.timestamps.trashed = datetime.datetime.utcnow() if value else NodeTimestamps.int_to_dt(0)
        self.touch()
github kiwiz / gkeepapi / gkeepapi / node.py View on Github external
def _load(self, raw):
        super(NodeDrawingInfo, self)._load(raw)
        self.drawing_id = raw['drawingId']
        self.snapshot.load(raw['snapshotData'])
        self._snapshot_fingerprint = raw['snapshotFingerprint'] if 'snapshotFingerprint' in raw else self._snapshot_fingerprint
        self._thumbnail_generated_time = NodeTimestamps.str_to_dt(raw['thumbnailGeneratedTime']) if 'thumbnailGeneratedTime' in raw else NodeTimestamps.int_to_dt(0)
        self._ink_hash = raw['inkHash'] if 'inkHash' in raw else ''
        self._snapshot_proto_fprint = raw['snapshotProtoFprint'] if 'snapshotProtoFprint' in raw else self._snapshot_proto_fprint