Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pep8 applied #303

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pyrebase/pyrebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

try:
from urllib.parse import urlencode, quote
except:
except ImportError:
from urllib import urlencode, quote
import json
import math
Expand Down Expand Up @@ -324,8 +324,7 @@ def stream(self, stream_handler, token=None, stream_id=None):
def check_token(self, database_url, path, token):
if token:
return '{0}{1}.json?auth={2}'.format(database_url, path, token)
else:
return '{0}{1}.json'.format(database_url, path)
return '{0}{1}.json'.format(database_url, path)

def generate_key(self):
push_chars = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'
Expand Down Expand Up @@ -399,8 +398,7 @@ def put(self, file, token=None):
blob = self.bucket.blob(path)
if isinstance(file, str):
return blob.upload_from_filename(filename=file)
else:
return blob.upload_from_file(file_obj=file)
return blob.upload_from_file(file_obj=file)
else:
request_object = self.requests.post(request_ref, data=file_object)
raise_detailed_error(request_object)
Expand Down
6 changes: 2 additions & 4 deletions sseclient/sseclient.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import re
import time
import warnings
import threading
import six

import requests

import six

# Technically, we should support streams that mix line endings. This regex,
# however, assumes that a system will provide consistent line endings.
end_of_field = re.compile(r'\r\n\r\n|\r\r|\n\n')


class SSEClient(object):
def __init__(self, url, session, build_headers, last_id=None, retry=3000, **kwargs):
self.url = url
Expand Down