File: fileBackedObject.py

package info (click to toggle)
subuser 0.6.2-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,216 kB
  • sloc: python: 5,204; sh: 380; makefile: 73; javascript: 43
file content (19 lines) | stat: -rwxr-xr-x 424 bytes parent folder | download | duplicates (2)
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