mirror of
https://github.com/rembo10/headphones.git
synced 2026-04-04 20:19:27 +01:00
Merge pull request #25 from gugahoi/master
Restart function courtesy of gugahoi
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.pyc
|
||||
*.log
|
||||
BIN
data/images/restart.png
Normal file
BIN
data/images/restart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
BIN
data/images/shutdown.png
Normal file
BIN
data/images/shutdown.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@@ -23,7 +23,10 @@ _nav = '''<div class="nav">
|
||||
<a href="/manage">MANAGE</a>
|
||||
<a href="/history">HISTORY</a>
|
||||
<a href="/config">SETTINGS</a>
|
||||
<a href="/shutdown"><font color="red">SHUTDOWN</font></a>
|
||||
<div style="float:right">
|
||||
<a href="/restart"><img src="data/images/restart.png" height="15px" width="15px"></a>
|
||||
<a href="/shutdown"><img src="data/images/shutdown.png" height="15px" width="15px"></a>
|
||||
</div>
|
||||
</div>'''
|
||||
|
||||
_footer = '''
|
||||
|
||||
12
webServer.py
12
webServer.py
@@ -434,3 +434,15 @@ class Headphones:
|
||||
sys.exit(0)
|
||||
|
||||
shutdown.exposed = True
|
||||
|
||||
def restart(self):
|
||||
logger.log(u"Restarting Headphones.")
|
||||
restart = True
|
||||
#answer = raw_input("Do you want to restart this program ? ")
|
||||
#if answer.strip() in "y Y yes Yes YES".split():
|
||||
#restart = True
|
||||
if restart:
|
||||
python = sys.executable
|
||||
os.execl(python, python, * sys.argv)
|
||||
|
||||
restart.exposed = True
|
||||
Reference in New Issue
Block a user