-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de910d8
commit 62dd089
Showing
3 changed files
with
75 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ map*.bin | |
process.log* | ||
xml/ | ||
*.xml | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import bin2xml | ||
from bottle import * | ||
|
||
@route('/') | ||
@route('/info') | ||
@route('/map') | ||
@route('/map/') | ||
@route('/mapid') | ||
@route('/mapid/') | ||
def info(): | ||
text = "Use http://url:port/map/[map name] to load a map by name<br>" | ||
text += "Use http://url:port/mapid/[map db id] to load a map by an id<br>" | ||
|
||
|
||
@route('/map/<name>') | ||
def map(name): | ||
return "Loading '%s'" % name | ||
|
||
|
||
@route('/map/test') | ||
def map(name): | ||
return static_file("/raidstore/netbeans/uniwar-map/xml/EdTestairisland.xml", root='') | ||
|
||
|
||
@route('/mapid/<id:int>') | ||
def mapid(id): | ||
binfile = "map.bin.files/map" + str(id) + ".bin" | ||
xmlfile = bin2xml.bin2xml(binfile, 'xml') | ||
print (("Loading '" + xmlfile + "' ( " + binfile + " )")) | ||
|
||
return static_file(xmlfile, root='./') | ||
|
||
|
||
run(host='localhost', port=8080, debug=True) |