Skip to content

Commit

Permalink
more durable
Browse files Browse the repository at this point in the history
  • Loading branch information
hrik2001 committed Dec 10, 2017
1 parent 08d8250 commit 86ba29e
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions function.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from subprocess import *
from threading import Thread
import queue
from sys import exit
#from pprint import pprint

__author__ = "Shatabarto \"Rik\" Bhattacharya "
Expand All @@ -16,16 +17,24 @@

def read_plist(directory):
''' This function returns a tuple which contains (bundle_identifier , bundle_name , bundle_signature) of an app '''
plistfile = plistlib.readPlist(directory)
bundle_identifier = plistfile['CFBundleIdentifier']
#bundle_signature = plistfile['CFBundleSignature']
bundle_name = plistfile['CFBundleName']
return (bundle_identifier , bundle_name) # , bundle_signature) #not in order :P
if os.path.isfile(directory):
plistfile = plistlib.readPlist(directory)
bundle_identifier = plistfile['CFBundleIdentifier']
#bundle_signature = plistfile['CFBundleSignature']
bundle_name = plistfile['CFBundleName']
return (bundle_identifier , bundle_name) # , bundle_signature) #not in order :P
else:
a = directory.split("/")[len(directory.split("/"))-2]
a = a[0:len(a)-4]
return a , a


def find_plist(app_dir):
''' This function returns a string which points to the file location of Info.plist '''
return app_dir + "/Contents/Info.plist"
if os.path.isdir(app_dir):
return app_dir + "/Contents/Info.plist"
else:
exit("\033[1m\033[31mError:\033[0m Application doesn't exist.\nmacuninstaller will quit now")

def find_user():
''' This function returns the username of the user, so that we can search user's directory '''
Expand Down

0 comments on commit 86ba29e

Please sign in to comment.