mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
parent
55b98f93db
commit
48a3506d77
1 changed files with 13 additions and 2 deletions
|
@ -1,9 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import biplist
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
# Before Python 3.4, use biplist; afterwards, use plistlib
|
||||
if sys.version_info < (3, 4):
|
||||
import biplist
|
||||
def read_plist(path):
|
||||
return biplist.readPlist(path)
|
||||
else:
|
||||
import plistlib
|
||||
def read_plist(path):
|
||||
with open(path, 'rb') as f:
|
||||
return plistlib.load(f)
|
||||
|
||||
#
|
||||
# Example settings file for dmgbuild
|
||||
#
|
||||
|
@ -22,7 +33,7 @@ appname = os.path.basename(application)
|
|||
|
||||
def icon_from_app(app_path):
|
||||
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
|
||||
plist = biplist.readPlist(plist_path)
|
||||
plist = read_plist(plist_path)
|
||||
icon_name = plist['CFBundleIconFile']
|
||||
icon_root,icon_ext = os.path.splitext(icon_name)
|
||||
if not icon_ext:
|
||||
|
|
Loading…
Reference in a new issue