Skip to content

Instantly share code, notes, and snippets.

@setkeh
Created June 20, 2013 08:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save setkeh/5821194 to your computer and use it in GitHub Desktop.
Save setkeh/5821194 to your computer and use it in GitHub Desktop.
"""
Web Front end to Cgminer-python
Written by: Setkeh setkeh <at> gmail <dot> com
https://github.com/setkeh
"""
# Import CherryPy global namespace
import cherrypy
from scripts.cgminerversion import *
class Root():
@cherrypy.expose
def index(self):
return '''<html>
<head>
<title>Cgminer Python Stats</title>
</head>
<body>'''
@cherrypy.expose
def header(self):
return '''<center><h1>Cgminer - Python Stats</h1></center>'''
@cherrypy.expose
def cgversion(self):
return '''<Center><p>Cgminer Version: </p></center>''', cg_version()
@cherrypy.expose
def footer(self):
return '''</body></html>'''
import os.path
mainconf = os.path.join(os.path.dirname(__file__), 'main.conf')
if __name__ == '__main__':
cherrypy.quickstart(Root(), config=mainconf)
else:
cherrypy.tree.mount(Root(), config=mainconf)
@editpro0987
Copy link

main.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment