Exemplo n.º 1
0
def output():
	try:
		crash_grid = CrashGrid('Crashes')
		ret = env.get_template('list.html').render( crash_grid=crash_grid, kw=dict(request.POST) )
		return ret

	except Exception, m:
		return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 2
0
def output():
    try:
        crash_grid = CrashGrid('Crashes')
        ret = env.get_template('list.html').render(crash_grid=crash_grid,
                                                   kw=dict(request.POST))
        return ret

    except Exception, m:
        return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 3
0
def output():
	try:
		session = db.sessionmaker()
		crash_table = CrashTable(session)
		crash_filler = CrashTableFiller(session)
		ret = env.get_template('list.html').render( widget=crash_table, value=crash_filler.get_value() )
		session.close()
		return ret

	except Exception, m:
		return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 4
0
def output():
    try:
        session = db.sessionmaker()
        upload_dir = config.get("site", "uploads")
        records = session.query(Record).all()
        ret = env.get_template("list.html").render(records=records)
        session.close()
        return ret

    except Exception, m:
        return env.get_template("error.html").render(err_msg=str(m))
Exemplo n.º 5
0
def output(session,id=1):
	tourney = session.query( Tourney ).filter( Tourney.id == id ).first()
	if not tourney:
		raise ElementNotFoundException( id )

	ret = env.get_template('tourney.html').render( tourney=tourney )
	return ret
Exemplo n.º 6
0
def output():
	try:
		session = db.sessionmaker()
		id = getSingleField( 'id', request )
		if not id:
			raise ElementNotFoundException( id )
		record = session.query( Record ).filter( Record.id == id ).one()
		if not record:
			raise ElementNotFoundException( id )
		upload_dir = config.get('site','uploads')
		ret = env.get_template('details.html').render( record=record, upload_dir=upload_dir )
		session.close()
		return ret

	except Exception, m:
		return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 7
0
def output():
	try:
		session = db.sessionmaker()
		id = getSingleField( 'id', request )
		if not id:
			raise ElementNotFoundException( id )
		crash = session.query( Crash ).filter( Crash.id == id ).one()
		if not crash:
			raise ElementNotFoundException( id )
		upload_dir = config.get('site','uploads')
		ret = env.get_template('details.html').render( crash=crash, \
			upload_dir=upload_dir,settings=dict(filter(lambda i: i[0] in Crash.important_settings, crash.settings.items() ) ) )
		session.close()
		return ret

	except Exception, m:
		return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 8
0
def output():
	try:
		important_settings = ['Shadows']

		session = db.sessionmaker()
		id = getSingleField( 'id', request )
		if not id:
			raise ElementNotFoundException( id )
		crash = session.query( Crash ).filter( Crash.id == id ).one()
		if not crash:
			raise ElementNotFoundException( id )
		upload_dir = config.get('site','uploads')
		print crash.stacktrace
		ret = env.get_template('details.html').render( crash=crash, upload_dir=upload_dir )
		session.close()
		return ret

	except Exception, m:
		return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 9
0
def output():
    try:
        important_settings = ['Shadows']

        session = db.sessionmaker()
        id = getSingleField('id', request)
        if not id:
            raise ElementNotFoundException(id)
        crash = session.query(Crash).filter(Crash.id == id).one()
        if not crash:
            raise ElementNotFoundException(id)
        upload_dir = config.get('site', 'uploads')
        print crash.stacktrace
        ret = env.get_template('details.html').render(crash=crash,
                                                      upload_dir=upload_dir)
        session.close()
        return ret

    except Exception, m:
        return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 10
0
def output(session, id=0):
    if not id:
        raise ElementNotFoundException(id)
    try:
        player = session.query(Player).filter(Player.id == id).one()
    except:
        try:
            player = session.query(Player).filter(Player.nick == id).one()
        except:
            raise ElementNotFoundException(id)

    ret = env.get_template("profile.html").render(player=player)
    return ret
Exemplo n.º 11
0
			def wrapper(*args, **kargs):
				print 'koko'
				global is_debug
				session = None
				if is_debug:
					session = db.sessionmaker()
					ret = f(session,*args, **kargs)
				else:
					try:
						session = db.sessionmaker()
						ret = f(session,*args,**kargs)
					except Exception, m:
						if session:
							session.close()
						return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 12
0
def output_post():
	try:
		data = request.POST['file'].value
		upload_dir = config.get('site','uploads')
		fn = '%s/%s/%s.zip'%( os.getcwd(), upload_dir,hashlib.sha224(data).hexdigest() )
		fd = open( fn, 'wb')
		fd.write( data )
		fd.close()
		new_id = parseZip( fn )
		base_url = config.get('site', 'baseurl' )
		chan = config.get('tasbot', 'report_channel' )
		tasbot.tasclient.say(chan,'new crash report uploaded: http://%s/details?id=%d'%(base_url,new_id))
		return 'success'

	except Exception, m:
		print m
		return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 13
0
def output_post():
    try:
        data = request.POST['file'].value
        upload_dir = config.get('site', 'uploads')
        fn_relative = '%s/%s.zip' % (upload_dir,
                                     hashlib.sha224(data).hexdigest())
        fn = fn_relative
        #fn = '%s/%s'%( os.getcwd(), fn_relative )
        fd = open(fn, 'wb')
        fd.write(data)
        fd.close()
        new_id = parseZip(fn)
        base_url = config.get('site', 'baseurl')
        chan = config.get('tasbot', 'report_channel')
        tasbot.tasclient.say(
            chan, 'new crash report uploaded: http://%s%d' %
            (config.get('site', 'detailurl'), new_id))
        return 'success'

    except Exception, m:
        print m
        return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 14
0
def output_post():
    try:
        data = request.POST["file"].value
        upload_dir = config.get("site", "uploads")
        fn = "%s/%s/%s.zip" % (os.getcwd(), upload_dir, hashlib.sha224(data).hexdigest())
        fd = open(fn, "wb")
        fd.write(data)
        fd.close()
        members = dict()
        zipfile = ZipFile(fn)

        files_of_interest = ["infolog.txt", "ext.txt", "platform.txt", "script.txt", "settings.txt", "unitsync.log"]
        for info in zipfile.infolist():
            if info.filename in files_of_interest and info.file_size < 20e5:
                members[info.filename] = zipfile.read(info.filename)
        new_id = db.parseZipMembers(fn, members)
        base_url = config.get("site", "baseurl")
        chan = config.get("tasbot", "report_channel")
        tasbot.tasclient.say(chan, "new crash report uploaded: http://%s/details?id=%d" % (base_url, new_id))
        return "success"

    except Exception, m:
        print m
        return env.get_template("error.html").render(err_msg=str(m))
Exemplo n.º 15
0
    def output():
        try:
            return env.get_template('upload.html').render()

        except Exception, m:
            return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 16
0
def output():
    try:
        return env.get_template("upload.html").render()

    except Exception, m:
        return env.get_template("error.html").render(err_msg=str(m))
Exemplo n.º 17
0
def output():
	try:
		return env.get_template('index.html').render( )
		
	except Exception, m:
		return env.get_template('error.html').render(err_msg=str(m))
Exemplo n.º 18
0
def output(session):
	ret = env.get_template('index.html').render( )
	return ret