summaryrefslogtreecommitdiffstats
path: root/Lib/plistlib.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-05-12 22:25:16 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-05-12 22:25:16 (GMT)
commit69a07fbd9b2c1e2d203532d4babbc6d874d389ee (patch)
tree822d06c6602339d309b30584ca0bfd05f5b56edc /Lib/plistlib.py
parenta005b34f14fd4548c84886244b68d2c34e75edbd (diff)
downloadcpython-69a07fbd9b2c1e2d203532d4babbc6d874d389ee.zip
cpython-69a07fbd9b2c1e2d203532d4babbc6d874d389ee.tar.gz
cpython-69a07fbd9b2c1e2d203532d4babbc6d874d389ee.tar.bz2
Remove the Mac modules
Diffstat (limited to 'Lib/plistlib.py')
-rw-r--r--Lib/plistlib.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index db5eea1..b775324 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -53,7 +53,6 @@ Parse Plist example:
__all__ = [
"readPlist", "writePlist", "readPlistFromBytes", "writePlistToBytes",
- "readPlistFromResource", "writePlistToResource",
"Plist", "Data", "Dict"
]
# Note: the Plist and Dict classes have been deprecated.
@@ -110,40 +109,6 @@ def writePlistToBytes(rootObject):
return f.getvalue()
-def readPlistFromResource(path, restype='plst', resid=0):
- """Read plst resource from the resource fork of path.
- """
- from Carbon.File import FSRef, FSGetResourceForkName
- from Carbon.Files import fsRdPerm
- from Carbon import Res
- fsRef = FSRef(path)
- resNum = Res.FSOpenResourceFile(fsRef, FSGetResourceForkName(), fsRdPerm)
- Res.UseResFile(resNum)
- plistData = Res.Get1Resource(restype, resid).data
- Res.CloseResFile(resNum)
- return readPlistFromString(plistData)
-
-
-def writePlistToResource(rootObject, path, restype='plst', resid=0):
- """Write 'rootObject' as a plst resource to the resource fork of path.
- """
- from Carbon.File import FSRef, FSGetResourceForkName
- from Carbon.Files import fsRdWrPerm
- from Carbon import Res
- plistData = writePlistToString(rootObject)
- fsRef = FSRef(path)
- resNum = Res.FSOpenResourceFile(fsRef, FSGetResourceForkName(), fsRdWrPerm)
- Res.UseResFile(resNum)
- try:
- Res.Get1Resource(restype, resid).RemoveResource()
- except Res.Error:
- pass
- res = Res.Resource(plistData)
- res.AddResource(restype, resid, '')
- res.WriteResource()
- Res.CloseResFile(resNum)
-
-
class DumbXMLWriter:
def __init__(self, file, indentLevel=0, indent="\t"):
self.file = file