How to use the sma.config.PATH_IMAGES function in sma

To help you get started, we’ve selected a few sma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sdockray / sma / sma / server.py View on Github external
""" % value
		elif action=='build_group':
			fb = FB(cherrypy.session['access_token'])
			fb.rebuild_group(value, do_snaps=True)
			content = """
Step 3: You're done!
--------------------
You can now see the archive [here](/group/%s)
			""" % value
		return html(markdown2.markdown(content))


# Starting things up
if __name__ == '__main__':
	conf = {
		'/'+PATH_IMAGES: {'tools.staticdir.on': True, 'tools.staticdir.dir': '/Users/dddd/Documents/dev/social-archives/archives'},
		'/css': {'tools.staticdir.on': True, 'tools.staticdir.dir': '/Users/dddd/Documents/dev/social-archives/css'},		
	}
	cherrypy.config.update({
		'tools.sessions.on': True
	})
	app = cherrypy.tree.mount(ArchiveServer(), '/')
	# for Facebook authentication
	fb_auth = cherrypy.tree.mount(FBAuth(), '/auth/fb/')
	cherrypy.quickstart(app,config=conf)
github sdockray / sma / sma / uwsgi.py View on Github external
def application(environ, start_response):
	conf = {
		'/'+PATH_IMAGES: {'tools.staticdir.on': True, 'tools.staticdir.dir': SERVER_IMAGES},
		'/css': {'tools.staticdir.on': True, 'tools.staticdir.dir': SERVER_CSS},		
	}
	cherrypy.config.update({
		'tools.sessions.on': True,
		'tools.sessions.storage_type': 'file',
		'tools.sessions.storage_path': SERVER_SESSIONS,
		'server.socket_port': SERVER_PORT
	})
	app = cherrypy.tree.mount(ArchiveServer(), '/', config=conf)
	return cherrypy.tree(environ, start_response)
github sdockray / sma / sma / files.py View on Github external
def tnurl(path):
	path = tn(path)
	return re.sub('^'+DIR_BASE+'/', '/'+PATH_IMAGES+'/', path)