mirror of
https://github.com/onionshare/onionshare.git
synced 2025-09-19 12:04:42 -04:00
made pyinstaller work for windows (#35)
This commit is contained in:
parent
fc13ef5707
commit
cf7d04099e
5 changed files with 35 additions and 17 deletions
|
@ -26,17 +26,7 @@ import logging
|
|||
log_handler = logging.FileHandler('{0}/onionshare.web.log'.format(temp_dir))
|
||||
log_handler.setLevel(logging.WARNING)
|
||||
|
||||
template_folder = './templates'
|
||||
if platform.system() == 'Windows':
|
||||
# pyinstaller sets sys.frozen=1 on run
|
||||
application_path = ""
|
||||
if getattr(sys, "frozen", False):
|
||||
application_path = os.path.dirname(sys.executable)
|
||||
elif __file__:
|
||||
application_path = os.path.dirname(__file__)
|
||||
template_path = os.path.join(application_path, "templates")
|
||||
|
||||
app = Flask(__name__, template_folder=template_path)
|
||||
app = Flask(__name__, template_folder='./templates')
|
||||
app.logger.addHandler(log_handler)
|
||||
|
||||
@app.route("/")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue