mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
commit
185006d662
@ -17,7 +17,7 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import sys, os, inspect, hashlib, base64, hmac, platform, zipfile, tempfile, math, time
|
||||
import sys, os, inspect, hashlib, base64, platform, zipfile, tempfile, math, time
|
||||
from random import SystemRandom
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import os, sys, subprocess, time, argparse, inspect, shutil, socket, threading
|
||||
import os, sys, time, argparse, shutil, socket, threading
|
||||
|
||||
from . import strings, helpers, web, hs
|
||||
|
||||
|
@ -17,7 +17,7 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import json, locale, sys, os
|
||||
import json, locale, os
|
||||
|
||||
from . import helpers
|
||||
|
||||
|
@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import queue, mimetypes, platform, os, sys
|
||||
from urllib.request import urlopen
|
||||
from flask import Flask, Response, request, render_template_string, abort
|
||||
from functools import wraps
|
||||
|
||||
from . import strings, helpers
|
||||
|
||||
@ -231,7 +230,7 @@ def download(slug_candidate):
|
||||
# The user has canceled the download, so stop serving the file
|
||||
if client_cancel:
|
||||
add_request(REQUEST_CANCELED, path, {'id': download_id})
|
||||
break;
|
||||
break
|
||||
|
||||
chunk = fp.read(chunk_size)
|
||||
if chunk == b'':
|
||||
|
@ -17,9 +17,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from onionshare import helpers
|
||||
from nose import with_setup
|
||||
|
||||
import test_helpers
|
||||
|
||||
def test_get_platform_returns_platform_system():
|
||||
"""get_platform() returns platform.system() when ONIONSHARE_PLATFORM is not defined"""
|
||||
|
@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import locale
|
||||
from onionshare import strings
|
||||
from nose import with_setup
|
||||
|
||||
|
||||
def test_starts_with_empty_strings():
|
||||
|
@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import socket
|
||||
from onionshare import OnionShare
|
||||
from nose import with_setup
|
||||
|
||||
|
||||
def test_choose_port_returns_a_port_number():
|
||||
|
@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import tempfile
|
||||
import os
|
||||
|
||||
|
||||
class MockSubprocess():
|
||||
@ -31,9 +32,7 @@ class MockSubprocess():
|
||||
|
||||
|
||||
def write_tempfile(text):
|
||||
tempdir = tempfile.mkdtemp()
|
||||
path = tempdir + "/test-file.txt"
|
||||
path = os.path.join(tempfile.mkdtemp(), "/test-file.txt")
|
||||
with open(path, "w") as f:
|
||||
f.write(text)
|
||||
f.close()
|
||||
return path
|
||||
|
Loading…
Reference in New Issue
Block a user