mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Move imports to module level
This commit is contained in:
parent
7a46336149
commit
76937d5cb5
@ -17,7 +17,7 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
import queue, mimetypes, platform, os, sys
|
import queue, mimetypes, platform, os, sys, socket, logging
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
from flask import Flask, Response, request, render_template_string, abort
|
from flask import Flask, Response, request, render_template_string, abort
|
||||||
|
|
||||||
@ -136,8 +136,6 @@ def debug_mode():
|
|||||||
"""
|
"""
|
||||||
Turn on debugging mode, which will log flask errors to a debug file.
|
Turn on debugging mode, which will log flask errors to a debug file.
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
|
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
temp_dir = os.environ['Temp'].replace('\\', '/')
|
temp_dir = os.environ['Temp'].replace('\\', '/')
|
||||||
else:
|
else:
|
||||||
@ -360,8 +358,6 @@ def stop(port):
|
|||||||
# to stop flask, load http://127.0.0.1:<port>/<shutdown_slug>/shutdown
|
# to stop flask, load http://127.0.0.1:<port>/<shutdown_slug>/shutdown
|
||||||
try:
|
try:
|
||||||
if transparent_torification:
|
if transparent_torification:
|
||||||
import socket
|
|
||||||
|
|
||||||
s = socket.socket()
|
s = socket.socket()
|
||||||
s.connect(('127.0.0.1', port))
|
s.connect(('127.0.0.1', port))
|
||||||
s.sendall('GET /{0:s}/shutdown HTTP/1.1\r\n\r\n'.format(shutdown_slug))
|
s.sendall('GET /{0:s}/shutdown HTTP/1.1\r\n\r\n'.format(shutdown_slug))
|
||||||
|
Loading…
Reference in New Issue
Block a user