示例#1
0
    return bottle.static_file('sitemap2.xml.gz', root=STATIC_FILES_DIR, mimetype="application/x-gzip")

@bottle.get('/sitemap_index.xml')
def get_sitemap_xml_gz():
    return bottle.static_file('sitemap_index.xml', root=STATIC_FILES_DIR, mimetype="application/xml")

# Process to run
class SitemapParserTestServer(pyservice.Process):

    pidfile = os.path.join(os.getcwd(), 'tests/run/test_server.pid')
    logfile = os.path.join(os.getcwd(), 'tests/log/test_server.log')

    def __init__(self):
        super(SitemapParserTestServer, self).__init__()
        
        from BaseHTTPServer import BaseHTTPRequestHandler
        BaseHTTPRequestHandler.log_message = log_message
            
    def run(self):
        logging.info('Bottle {} server starting up'.format(bottle.__version__))
        bottle.debug(True)
        bottle.run(host='localhost', port=8080)

if __name__ == '__main__':

    if len(sys.argv) == 2 and sys.argv[1] in 'start stop restart status'.split():
        pyservice.service('test_server.SitemapParserTestServer', sys.argv[1])
    else:
        print 'usage: SitemapParserTestServer <start,stop,restart,status>'
        
	return bottle.static_file(path,root=STATIC_ROOT)

@bottle.error(404)
def error404(error):
	logging.debug("@bottle.error(404)")
	return 'Nothing here, sorry'


# Process to run
class BottleProcess(pyservice.Process):

        pidfile = os.path.join(os.getcwd(), 'run/bottle.pid')
        logfile = os.path.join(os.getcwd(), 'log/bottle.log')

        def __init__(self):
                super(BottleProcess, self).__init__()

                from BaseHTTPServer import BaseHTTPRequestHandler
                BaseHTTPRequestHandler.log_message = log_message

        def run(self):
                logging.info('Bottle {} server starting up'.format(bottle.__version__))
                bottle.run(host='localhost', port=8080)

if __name__ == '__main__':

        if len(sys.argv) == 2 and sys.argv[1] in 'start stop restart status'.split():
                pyservice.service('getseal_background.BottleProcess', sys.argv[1])
        else:
                print 'usage: getseal_background <start,stop,restart,status>'
示例#3
0
def get_sitemap_xml_gz():
    return bottle.static_file('sitemap2.xml.gz', root=STATIC_FILES_DIR, mimetype="application/x-gzip")

@bottle.get('/sitemap_index.xml')
def get_sitemap_xml_gz():
    return bottle.static_file('sitemap_index.xml', root=STATIC_FILES_DIR, mimetype="application/xml")

# Process to run
class PywsinfoTestServer(pyservice.Process):

    pidfile = os.path.join(os.getcwd(), 'tests/run/test_server.pid')
    logfile = os.path.join(os.getcwd(), 'tests/log/test_server.log')

    def __init__(self):
        super(PywsinfoTestServer, self).__init__()
        
        from BaseHTTPServer import BaseHTTPRequestHandler
        BaseHTTPRequestHandler.log_message = log_message
            
    def run(self):
        logging.info('Bottle {} server starting up'.format(bottle.__version__))
        bottle.debug(True)
        bottle.run(host='localhost', port=8080)

if __name__ == '__main__':

    if len(sys.argv) == 2 and sys.argv[1] in 'start stop restart status'.split():
        pyservice.service('test_server.PywsinfoTestServer', sys.argv[1])
    else:
        print 'usage: PywsinfoTestServer <start,stop,restart,status>'
示例#4
0
from packages import pywebase

# -----------------------------------------------
#   Application functions (they can be changed 
#   in your application)
# -----------------------------------------------

pywebase.add_routes(
    ('/', 'GET', pywebase.handle_index),
    ('/favicon.ico', 'GET', pywebase.handle_favicon),
    ('/static/<filepath:path>', 'GET', pywebase.handle_static),
    ('/login', 'GET', pywebase.handle_login),
    ('/logout', 'GET', pywebase.handle_logout),
)

# -----------------------------------------------
#   Main
# -----------------------------------------------

if __name__ == '__main__':
    
    import sys
    from packages import pyservice

    if len(sys.argv) == 2 and sys.argv[1] in 'start stop restart status'.split():
        pyservice.service('packages.pywebase.PywebaseProcess', sys.argv[1])
    else:
        print 'usage: manage <start,stop,restart,status>'

示例#5
0
    return bottle.static_file('sitemap_index.xml',
                              root=STATIC_FILES_DIR,
                              mimetype="application/xml")


# Process to run
class SitemapParserTestServer(pyservice.Process):

    pidfile = os.path.join(os.getcwd(), 'tests/run/test_server.pid')
    logfile = os.path.join(os.getcwd(), 'tests/log/test_server.log')

    def __init__(self):
        super(SitemapParserTestServer, self).__init__()

        from BaseHTTPServer import BaseHTTPRequestHandler
        BaseHTTPRequestHandler.log_message = log_message

    def run(self):
        logging.info('Bottle {} server starting up'.format(bottle.__version__))
        bottle.debug(True)
        bottle.run(host='localhost', port=8080)


if __name__ == '__main__':

    if len(sys.argv) == 2 and sys.argv[1] in 'start stop restart status'.split(
    ):
        pyservice.service('test_server.SitemapParserTestServer', sys.argv[1])
    else:
        print 'usage: SitemapParserTestServer <start,stop,restart,status>'
示例#6
0
# Application
@bottle.route("/")
def index():
    return "BottleProcess"


# Process to run
class BottleProcess(pyservice.Process):

    pidfile = os.path.join(os.getcwd(), "run/bottle.pid")
    logfile = os.path.join(os.getcwd(), "log/bottle.log")

    def __init__(self):
        super(BottleProcess, self).__init__()

        from BaseHTTPServer import BaseHTTPRequestHandler

        BaseHTTPRequestHandler.log_message = log_message

    def run(self):
        logging.info("Bottle {} server starting up".format(bottle.__version__))
        bottle.run(host="localhost", port=8080)


if __name__ == "__main__":

    if len(sys.argv) == 2 and sys.argv[1] in "start stop restart status".split():
        pyservice.service("bottled.BottleProcess", sys.argv[1])
    else:
        print "usage: bottled <start,stop,restart,status>"
示例#7
0
# Application
@bottle.route('/')
def index():
    return 'BottleProcess'


# Process to run
class BottleProcess(pyservice.Process):

    pidfile = os.path.join(os.getcwd(), 'run/bottle.pid')
    logfile = os.path.join(os.getcwd(), 'log/bottle.log')

    def __init__(self):
        super(BottleProcess, self).__init__()

        from BaseHTTPServer import BaseHTTPRequestHandler
        BaseHTTPRequestHandler.log_message = log_message

    def run(self):
        logging.info('Bottle {} server starting up'.format(bottle.__version__))
        bottle.run(host='localhost', port=8080)


if __name__ == '__main__':

    if len(sys.argv) == 2 and sys.argv[1] in 'start stop restart status'.split(
    ):
        pyservice.service('bottled.BottleProcess', sys.argv[1])
    else:
        print 'usage: bottled <start,stop,restart,status>'