~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/web/trp.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
 
2
# See LICENSE for details.
 
3
 
 
4
"""
 
5
I contain ResourceUnpickler, which will unpickle any python object
 
6
named with the file extension .trp.
 
7
"""
 
8
 
 
9
import warnings
 
10
from pickle import Unpickler
 
11
 
 
12
_msg = ("is deprecated as of Twisted 9.0.  Resource persistence "
 
13
        "is beyond the scope of Twisted Web.")
 
14
 
 
15
warnings.warn("twisted.web.trp " + _msg , DeprecationWarning, stacklevel=2)
 
16
 
 
17
def ResourceUnpickler(path, registry = None):
 
18
    warnings.warn(
 
19
        "twisted.web.trp.ResourceUnpickler " + _msg ,
 
20
        DeprecationWarning, stacklevel=2)
 
21
    fl = open(path)
 
22
    result = Unpickler(fl).load()
 
23
    return result