File: fileBackedObject.py

package info (click to toggle)
subuser 0.6.2-3
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 4,208 kB
  • sloc: python: 5,201; sh: 380; makefile: 73
file content (19 lines) | stat: -rwxr-xr-x 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
# pylint: disable=no-init,old-style-class

"""
If an object has persistant state which needs to be serialzed to disk, that object should be backed by a file.
"""

#external imports
import abc
#internal imports
#import ...

class FileBackedObject():
  __metaclass__ = abc.ABCMeta

  @abc.abstractmethod
  def save(self):
    """ Serialize the object to it's appropriate location on disk. """
    pass