Merge pull request #280 from jvoisin/pep8

Improve pep8 conformance
This commit is contained in:
Micah Lee 2016-06-10 17:14:11 -07:00 committed by GitHub
commit 185006d662
8 changed files with 6 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'':

View File

@ -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"""

View File

@ -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():

View File

@ -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():

View File

@ -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