예제 #1
0
def main(n):
        if len(n) == 0:
                print "Give pagenumber or full link as an argument"
                sys.exit(1)
        else:
                np=necroposter()
                np.dw_wapage('6714')
                np.init_data()
                s=storage(n[0],np)
                s.init()
예제 #2
0
def application(environ, start_response):
        fields = parse_formvars(environ)
        if environ['REQUEST_METHOD'] == 'GET':
                start_response('200 OK', [('content-type','text/html; charset=utf-8')])
                np=necroposter()
                np.dw_wapage(fields['wa_addr'])
                np.init_data()
                tpl=""
                for q in np.episodes:
                        if q != None:
                                    tpl += str(q) + "<br>\n"
                return [str(tpl)]
        else:
                start_response('200 OK', [('content-type', 'text/html; charset=utf-8')])
                tmpl_fl=os.path.join(cp, 'templates/form.tmpl')
                k=Template(file=tmpl_fl)
                return [str(k)]
예제 #3
0
def application(environ, start_response):
        fields = parse_formvars(environ)
        tplvars={"tpl":""}
        print fields
        if environ['REQUEST_METHOD'] == 'POST' and fields['wa_addr'] != "":
                np=necroposter()
                np.dw_wapage(fields['wa_addr'])
                np.init_data()
	        #print fields['doupload']
                tplvars['tpl']=str(np.gen_bbcode().encode('utf-8'))
                
		tplvars["page_id"]=np.pagenum       	
        else:
        	pass
	
        start_response('200 OK', [('content-type', 'text/html; charset=utf-8')])
	
        tmpl_fl=os.path.join(cp, 'templates/form.tmpl')
        k=Template(file=tmpl_fl,searchList=[tplvars])
        return [str(k)]
예제 #4
0
파일: gui.py 프로젝트: non7top/necroposter
    def refresh_info(self, item):
        id=self.ui.main_lw.row(item)
        path = self.list[id]['path']
        homepath=os.path.join(path,'.anime')
        idfile=os.path.join(homepath,'id')
        '''read id'''
        if os.path.exists(idfile):
            wa_id=int(open(idfile,'r').read().strip())
            print wa_id
        else:
            print "no cache"
            return

        np=necroposter(str(wa_id), homepath)
        self.ui.lb_title.setText(np.get_title())


        print np.fnames['studio_full']
        cover=QPixmap()
        if cover.load(np.fnames['cover_full']):
            self.ui.lb_cover.setPixmap(cover)
예제 #5
0
    def bot_wa (self, mess, args):
	"""Returns bb code"""
        np=necroposter()
        np.dw_wapage(str(args))
        np.init_data()
        return np.gen_bbcode()