[gtk-mac-bundler] Switch to new plistlib API.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-mac-bundler] Switch to new plistlib API.
- Date: Fri, 16 Aug 2019 20:16:46 +0000 (UTC)
commit 24f4950f854b05ff0628980138d4aef90cc6db0b
Author: John Ralls <jralls ceridwen us>
Date: Fri Aug 16 13:09:32 2019 -0700
Switch to new plistlib API.
bundler/bundler.py | 8 ++++----
bundler/project.py | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/bundler/bundler.py b/bundler/bundler.py
index b7b4ccc..dbbc033 100644
--- a/bundler/bundler.py
+++ b/bundler/bundler.py
@@ -7,7 +7,7 @@ import os, errno, glob
import shutil
import re
from subprocess import Popen
-from plistlib import Plist
+import plistlib
from .project import *
from . import utils
@@ -18,7 +18,7 @@ class Bundler(object):
self.project_dir = project.get_project_dir()
plist_path = self.project.get_plist_path()
- self.plist = Plist.fromFile(plist_path)
+ self.plist = plistlib.readPlist(plist_path)
# List of paths that should be recursively searched for
# binaries that are used to find library dependencies.
@@ -62,8 +62,8 @@ class Bundler(object):
path = self.project.get_bundle_path("Contents", "PkgInfo")
path = self.project.evaluate_path(path)
f = open (path, "w")
- f.write(self.plist.CFBundlePackageType)
- f.write(self.plist.CFBundleSignature)
+ f.write(self.plist['CFBundlePackageType'])
+ f.write(self.plist['CFBundleSignature'])
f.close()
def copy_plist(self):
diff --git a/bundler/project.py b/bundler/project.py
index 8cbcc58..b012876 100644
--- a/bundler/project.py
+++ b/bundler/project.py
@@ -7,7 +7,7 @@ import shutil
from subprocess import call, check_call, Popen, PIPE, STDOUT
import xml.dom.minidom
from xml.dom.minidom import Node
-from plistlib import Plist
+import plistlib
from . import utils
# Base class for anything that can be copied into a bundle with a
@@ -495,20 +495,20 @@ class Project(object):
plist_path = self.get_plist_path()
try:
- plist = Plist.fromFile(plist_path)
+ plist = plistlib.readPlist(plist_path)
except EnvironmentError as e:
if e.errno == errno.ENOENT:
print("Info.plist file not found: " + plist_path)
sys.exit(1)
else:
raise
- self.name = plist.CFBundleExecutable
+ self.name = plist['CFBundleExecutable']
if "CFBundleName" in plist:
- self.bundle_name = plist.CFBundleName
+ self.bundle_name = plist['CFBundleName']
else:
- self.bundle_name = plist.CFBundleExecutable
+ self.bundle_name = plist['CFBundleExecutable']
- self.bundle_id = plist.CFBundleIdentifier
+ self.bundle_id = plist['CFBundleIdentifier']
"""
Replace ${env:?}, ${prefix}, ${prefix:?}, ${project}, ${gtk}, ${gtkdir},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]