Добавлена проверка наличия программы kdialog и демона dbus,

перед их запуском.


git-svn-id: http://svn.calculate.ru/calculate2/calculate-client/trunk@1320 c91db197-33c1-4113-bf15-f8a5c547ca64
develop
mhiretskiy 15 years ago
parent f4831cfe7b
commit 7fc42724da

@ -60,22 +60,23 @@ org.kde.kdialog.ProgressDialog'
if max != None: if max != None:
self.max = max self.max = max
self.title = title self.title = title
self.label ="LOGINKDIALOG=%d" % os.getpid() if os.system('which kdialog >/dev/null') == 0:
pipe = popen2.Popen4(self.execenv + " %s " % self.label +\ self.label ="LOGINKDIALOG=%d" % os.getpid()
'/usr/bin/kdialog --progressbar "%s" %d' % (\ pipe = popen2.Popen4(self.execenv + " %s " % self.label +\
" "*(len(title)+20),self.max)) '/usr/bin/kdialog --progressbar "%s" %d' % (\
if pipe.poll() != 0: " "*(len(title)+20),self.max))
time.sleep(0.5) if pipe.poll() != 0:
if pipe.poll() == 0: time.sleep(0.5)
self.kdialog = pipe.fromchild.readline().strip() if pipe.poll() == 0:
while not "org.kde.kdialog" in self.kdialog: self.kdialog = pipe.fromchild.readline().strip()
s = fout.fromchild.readline() while not "org.kde.kdialog" in self.kdialog:
if s == "": s = fout.fromchild.readline()
self.shutdownDialog() if s == "":
self.kdialog = s.strip() self.shutdownDialog()
self.setTitle(self.title) self.kdialog = s.strip()
else: self.setTitle(self.title)
self.shutdownDialog() else:
self.shutdownDialog()
def shutdownDialog(self): def shutdownDialog(self):
'''Принудительно уничтожить процесс kdialog''' '''Принудительно уничтожить процесс kdialog'''
@ -1019,11 +1020,12 @@ or ld_bind_dn or ld_bind_pw")
--set-ldap_root=%s --set-ldap_bind=%s --set-ldap_bindpw=%s -P \ --set-ldap_root=%s --set-ldap_bind=%s --set-ldap_bindpw=%s -P \
install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw) install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
self.execProg(execStr) self.execProg(execStr)
textLines = self.execProg("/etc/init.d/dbus restart", False, False) if os.path.exists('/etc/init.d/dbus'):
if not (textLines and type(textLines) == types.ListType and\ textLines = self.execProg("/etc/init.d/dbus restart", False, False)
"ok" in textLines[-1] or textLines and "ok" in textLines): if not (textLines and type(textLines) == types.ListType and\
self.printWARNING(_("Error restarting /etc/init.d/dbus")+ " ...") "ok" in textLines[-1] or textLines and "ok" in textLines):
return False self.printWARNING(_("Error restarting /etc/init.d/dbus")+ " ...")
return False
self.printOK(_("Computer added to domain %s")%domain + " ...") self.printOK(_("Computer added to domain %s")%domain + " ...")
return True return True

Loading…
Cancel
Save