def OnDjangoFunc(win, event): _id = event.GetId() try: if hasattr(win, "IDPM_DJANGO_STARTAPP") and _id == win.IDPM_DJANGO_STARTAPP: OnDjangoStartApp(win) elif hasattr(win, "IDPM_DJANGO_INSTALLAPP") and _id == win.IDPM_DJANGO_INSTALLAPP: d = Casing.Casing(OnDjangoInstallApp, win) v = Casing.new_obj() v.count = 0 # d.onprocess(onprocess, v=v, timestep=0.1) # d.onsuccess(onsuccess) # d.onexception(onsuccess) d.start_thread() elif hasattr(win, "IDPM_DJANGO_INSTALLSYSAPP_ADMIN") and _id == win.IDPM_DJANGO_INSTALLSYSAPP_ADMIN: d = Casing.Casing(OnDjangoInstallConApp, win, "admin") v = Casing.new_obj() # d.onprocess(onprocess, v=v, timestep=0.1) # d.onsuccess(onsuccess) # d.onexception(onsuccess) d.start_thread() elif hasattr(win, "IDPM_DJANGO_RUNSERVER") and _id == win.IDPM_DJANGO_RUNSERVER: OnDjangoRunServer(win) elif hasattr(win, "IDPM_DJANGO_RUNSHELL") and _id == win.IDPM_DJANGO_RUNSHELL: OnDjangoRunShell(win) elif hasattr(win, "IDPM_DJANGO_DOT") and _id == win.IDPM_DJANGO_DOT: OnCreateDot(win) except: error.traceback() common.showerror(win, tr("There is some wrong as executing the menu."))
def get_casting(self, item): text = Casing.new_obj() text.text = '' node = self.sharewin.get_node(item) rssid = node['data']['id'] feedurl = str(node['data']['url']) d = Casing.Casing(self.get_feed, feedurl=feedurl, text=text) d += Casing.Casing(self.parse_content, rssid=rssid, text=text) d += Casing.Casing(self.update_feed_read, item=item) d.onexception(self.on_exception, item) d.onprocess(self.on_process, item=item) d.onsuccess(self.on_success, item) self.casings[item] = d return d
def OnDjangoFunc(win, event): _id = event.GetId() try: if hasattr(win, 'IDPM_DJANGO_STARTAPP') and _id == win.IDPM_DJANGO_STARTAPP: OnDjangoStartApp(win) elif hasattr(win, 'IDPM_DJANGO_INSTALLAPP' ) and _id == win.IDPM_DJANGO_INSTALLAPP: d = Casing.Casing(OnDjangoInstallApp, win) v = Casing.new_obj() v.count = 0 # d.onprocess(onprocess, v=v, timestep=0.1) # d.onsuccess(onsuccess) # d.onexception(onsuccess) d.start_thread() elif hasattr(win, 'IDPM_DJANGO_INSTALLSYSAPP_ADMIN' ) and _id == win.IDPM_DJANGO_INSTALLSYSAPP_ADMIN: d = Casing.Casing(OnDjangoInstallConApp, win, 'admin') v = Casing.new_obj() # d.onprocess(onprocess, v=v, timestep=0.1) # d.onsuccess(onsuccess) # d.onexception(onsuccess) d.start_thread() elif hasattr( win, 'IDPM_DJANGO_RUNSERVER') and _id == win.IDPM_DJANGO_RUNSERVER: OnDjangoRunServer(win) elif hasattr( win, 'IDPM_DJANGO_RUNSHELL') and _id == win.IDPM_DJANGO_RUNSHELL: OnDjangoRunShell(win) elif hasattr(win, 'IDPM_DJANGO_DOT') and _id == win.IDPM_DJANGO_DOT: OnCreateDot(win) except: error.traceback() common.showerror(win, tr("There is some wrong as executing the menu."))