Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Adjust win platform compile and run
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajunsu committed Jan 29, 2019
1 parent 68f5a1d commit da69ee3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 11 additions & 2 deletions calculator_of_Onmyoji/cm_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ConfigParser
import json
import os
import sys
import traceback

import flask
Expand All @@ -12,7 +13,15 @@
from calculator_of_Onmyoji import cal_mitama


app = flask.Flask(__name__)
if getattr(sys, 'frozen', False):
template_folder = os.path.join(sys.executable, '..', 'templates')
static_folder = os.path.join(sys.executable, '..', 'static')
app = flask.Flask(__name__,
template_folder=template_folder,
static_folder=static_folder)
else:
app = flask.Flask(__name__)

work_path = os.path.dirname(os.path.realpath(__file__))


Expand Down Expand Up @@ -56,4 +65,4 @@ def calculate():
conf.read(os.path.join(work_path, 'server.conf'))
app.run(host=conf.get('global', 'host'),
port=conf.get('global', 'port'),
debug=True)
)
5 changes: 4 additions & 1 deletion win_compile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ Destination platform: win 64bit

2.Must run setup.py install before compile

3.Update UI files
```cp calculator_of_Onmyoji/templates dist/ -r; cp calculator_of_Onmyoji/static dist -r;cp calculator_of_Onmyoji/server.conf dist```

### Compile:

```wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/cal_mitama.py -p /usr/local/lib/python2.7/dist-packages/ ;wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/pull_mitama.py -p /usr/lib/python2.7/dist-packages/ -p /usr/local/lib/python2.7/dist-packages/ ; wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/convert_json2xls.py -p /usr/lib/python2.7/dist-packages/ -p /usr/local/lib/python2.7/dist-packages/; wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/result_combination.py -p ~/.wine/drive_c/Python27/Lib/site-packages/```
```wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/cal_mitama.py -p /usr/local/lib/python2.7/dist-packages/ ;wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/pull_mitama.py -p /usr/lib/python2.7/dist-packages/ -p /usr/local/lib/python2.7/dist-packages/ ; wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/convert_json2xls.py -p /usr/lib/python2.7/dist-packages/ -p /usr/local/lib/python2.7/dist-packages/; wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/result_combination.py -p ~/.wine/drive_c/Python27/Lib/site-packages/; wine ~/.wine/drive_c/Python27/Scripts/pyinstaller.exe -F calculator_of_Onmyoji/cm_server.py -p ~/.wine/drive_c/Python27/Lib/site-packages/```


### For 32bit

Expand Down

0 comments on commit da69ee3

Please sign in to comment.