Ejemplo n.º 1
0
  def context(self):
    if self.cached_context_data is not None:
      return self.cached_context_data

    context_path = self.fs_path[ :-len(self.extension) ] + '.context.pickle'

    if exists(context_path):
      fh = open(context_path, 'rb')
      context_data = unpickle.load(fh)
      fh.close()
    else:
      context_data = {}

    self.cached_context_data = context_data
    return context_data
Ejemplo n.º 2
0
def load_whitelist():
    fh = open(settings.WHITELIST_FILE, "rb")
    whitelist = unpickle.load(fh)
    fh.close()
    return whitelist