def toDefString(self): """docstring for toDefString""" instr = plistlib.writePlistToString(self.defaults) runObj = Popen('pl',shell=True,stdout=PIPE,stdin=PIPE,stderr=STDOUT,close_fds=True) runObj.stdin.write(instr) runObj.stdin.close() defstr = runObj.stdout.read() return defstr.replace("\n","")
def toDefString(self): """docstring for toDefString""" instr = plistlib.writePlistToString(self.defaults) stdin,stdout = os.popen2('pl') stdin.write(instr) stdin.close() defstr = stdout.read() return defstr.replace("\n","")
def toDefString(self): """plist-formated string with preference values""" # instr = plistlib.writePlistToString(self.defaults) instr = plistlib.writePlistToString(self.defaults) runObj = Popen("pl", shell=True, stdout=PIPE, stdin=PIPE, stderr=STDOUT, close_fds=True) runObj.stdin.write(instr) # .encode("utf-8")) runObj.stdin.close() defstr = runObj.stdout.read() defstr = defstr.decode("utf-8") return defstr.replace("\n", "")