Skip to content

Commit

Permalink
pep8 e261
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Sep 28, 2017
1 parent 93b7fba commit 6b221d2
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions build/ccxt.php
Original file line number Diff line number Diff line change
Expand Up @@ -15960,8 +15960,8 @@ public function __construct ($options = array ()) {
),
'api' => array (
'public' => array (
'get' => array ( // last slash critical
'orderbook/',
'get' => array (
'orderbook/', // last slash critical
'orderbook_litecoin/',
'ticker/',
'ticker_litecoin/',
Expand Down
4 changes: 2 additions & 2 deletions ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -15457,8 +15457,8 @@ var mercado = {
},
'api': {
'public': {
'get': [ // last slash critical
'orderbook/',
'get': [
'orderbook/', // last slash critical
'orderbook_litecoin/',
'ticker/',
'ticker_litecoin/',
Expand Down
4 changes: 2 additions & 2 deletions ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

# -----------------------------------------------------------------------------

from ccxt.exchange import * # noqa: F403
from ccxt.exchanges import * # noqa: F403
from ccxt.exchange import * # noqa: F403
from ccxt.exchanges import * # noqa: F403

# -----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion ccxt/async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# -----------------------------------------------------------------------------

from ccxt.async.exchange import * # noqa: F403
from ccxt.async.exchanges import * # noqa: F403
from ccxt.async.exchanges import * # noqa: F403

# -----------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions ccxt/async/exchanges.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions ccxt/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@
# -----------------------------------------------------------------------------

try:
import urllib.parse as _urlencode # Python 3
import urllib.parse as _urlencode # Python 3
import urllib.request as _urllib
import http.client as httplib
except ImportError:
import urllib as _urlencode # Python 2
import urllib as _urlencode # Python 2
import urllib2 as _urllib
import httplib

# -----------------------------------------------------------------------------

try:
basestring # Python 3
basestring # Python 3
except NameError:
basestring = str # Python 2
basestring = str # Python 2

# -----------------------------------------------------------------------------

Expand All @@ -94,8 +94,8 @@ class Exchange(object):
id = None
version = None
enableRateLimit = False
rateLimit = 2000 # milliseconds = seconds * 1000
timeout = 10000 # milliseconds = seconds * 1000
rateLimit = 2000 # milliseconds = seconds * 1000
timeout = 10000 # milliseconds = seconds * 1000
asyncio_loop = None
aiohttp_session = None
userAgent = False
Expand Down Expand Up @@ -241,7 +241,7 @@ def fetch(self, url, method='GET', headers=None, body=None):
request.get_method = lambda: method
response = None
text = None
try: # send request and load response
try: # send request and load response
handler = _urllib.HTTPHandler if url.startswith('http://') else _urllib.HTTPSHandler
opener = _urllib.build_opener(handler)
response = opener.open(request, timeout=int(self.timeout / 1000))
Expand Down Expand Up @@ -336,7 +336,7 @@ def safe_float(object, key, default_value=None):
return default_value

@staticmethod
def capitalize(string): # first character only, rest characters unchanged
def capitalize(string): # first character only, rest characters unchanged
if len(string) > 1:
return "%s%s" % (string[0].upper(), string[1:])
return string.upper()
Expand Down
4 changes: 2 additions & 2 deletions ccxt/exchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -14074,8 +14074,8 @@ def __init__(self, config={}):
},
'api': {
'public': {
'get': [ # last slash critical
'orderbook/',
'get': [
'orderbook/', # last slash critical
'orderbook_litecoin/',
'ticker/',
'ticker_litecoin/',
Expand Down
4 changes: 2 additions & 2 deletions examples/py/asciichart.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def plot(series, cfg={}):
result[y - intmin2][offset - 1] = '┼' if y == 0 else '┤'

y0 = int(series[0] * ratio - min2)
result[rows - y0][offset - 1] = '┼' # first value
result[rows - y0][offset - 1] = '┼' # first value

for x in range(0, len(series) - 1): # plot the line
for x in range(0, len(series) - 1): # plot the line
y0 = int(round(series[x + 0] * ratio) - intmin2)
y1 = int(round(series[x + 1] * ratio) - intmin2)
if y0 == y1:
Expand Down
2 changes: 1 addition & 1 deletion examples/py/async-balance-gdax.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async def test():
'apiKey': "a43edfe629bc5991acc83a536ac6358e",
'secret': "xOvq+iH8NT07TheFB/fmY3GcnMZMwP7Xct9zwWtAZxsCbJh8rxeEe/0BGxfbV2em7P9iqQD7/TJGqmsDO8B/kw==",
'password': 'zdmj8o7byla',
'verbose': True, # switch it to False if you don't want the HTTP log
'verbose': True, # switch it to False if you don't want the HTTP log
})
# move gdax to sandbox
gdax.urls['api'] = 'https://api-public.sandbox.gdax.com'
Expand Down
2 changes: 1 addition & 1 deletion examples/py/async-balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async def test():
bittrex = ccxt.bittrex({
'apiKey': "c5af1d0ceeaa4729ad87da1b05d9dfc3",
'secret': "d055d8e47fdf4c3bbd0ec6c289ea8ffd",
'verbose': True, # switch it to False if you don't want the HTTP log
'verbose': True, # switch it to False if you don't want the HTTP log
})
print(await bittrex.fetch_balance())

Expand Down
4 changes: 2 additions & 2 deletions examples/py/async-balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ async def test(exchange):
kraken = ccxt.kraken({
'apiKey': "hEvQNMDIeoCJbr7W/ZBb5CGOrx3G0lWF5B3zqa1JBxdZlEaL8EK+D0Mw",
'secret': "JaE9wI6Nwgh5oRxiHcVxurwzwBxwc05W/qv/k1srGg4s3EYuXPpNkLLM5NYbbWpM8rCyijIeDavRuqWbU0ZV9A==",
'verbose': True, # switch it to False if you don't want the HTTP log
'verbose': True, # switch it to False if you don't want the HTTP log
})
bitfinex = ccxt.bitfinex({
'apiKey': "4FlEDtxDl35gdEiobnfZ72vJeZteE4Bb7JdvqzjIjHq",
'secret': "D4DXM8DZdHuAq9YptUsb42aWT1XBnGlIJgLi8a7tzFH",
'verbose': True, # switch it to False if you don't want the HTTP log
'verbose': True, # switch it to False if you don't want the HTTP log
})

[asyncio.ensure_future(test(exchange)) for exchange in [kraken, bitfinex]]
Expand Down
2 changes: 1 addition & 1 deletion examples/py/async-bitfinex-private-post-account-infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def test(exchange):
bitfinex = ccxt.bitfinex({
'apiKey': "4FlEDtxDl35gdEiobnfZ72vJeZteE4Bb7JdvqzjIjHq",
'secret': "D4DXM8DZdHuAq9YptUsb42aWT1XBnGlIJgLi8a7tzFH",
'verbose': True, # switch it to False if you don't want the HTTP log
'verbose': True, # switch it to False if you don't want the HTTP log
})

[asyncio.ensure_future(test(exchange)) for exchange in [bitfinex]]
Expand Down
2 changes: 1 addition & 1 deletion examples/py/balance-gdax.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'apiKey': "a43edfe629bc5991acc83a536ac6358e",
'secret': "xOvq+iH8NT07TheFB/fmY3GcnMZMwP7Xct9zwWtAZxsCbJh8rxeEe/0BGxfbV2em7P9iqQD7/TJGqmsDO8B/kw==",
'password': 'zdmj8o7byla',
'verbose': True, # switch it to False if you don't want the HTTP log
'verbose': True, # switch it to False if you don't want the HTTP log
})

# move gdax to sandbox
Expand Down
2 changes: 1 addition & 1 deletion examples/py/balance-kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
kraken = ccxt.kraken({
'apiKey': "hEvQNMDIeoCJbr7W/ZBb5CGOrx3G0lWF5B3zqa1JBxdZlEaL8EK+D0Mw",
'secret': "JaE9wI6Nwgh5oRxiHcVxurwzwBxwc05W/qv/k1srGg4s3EYuXPpNkLLM5NYbbWpM8rCyijIeDavRuqWbU0ZV9A==",
'verbose': True, # switch it to False if you don't want the HTTP log
'verbose': True, # switch it to False if you don't want the HTTP log
})

print(kraken.fetch_balance())
12 changes: 6 additions & 6 deletions examples/py/basic-chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# -----------------------------------------------------------------------------

import ccxt # noqa: E402
import ccxt # noqa: E402

# -----------------------------------------------------------------------------

Expand All @@ -23,7 +23,7 @@
symbol = 'BTC/USD'

# each ohlcv candle is a list of [ timestamp, open, high, low, close, volume ]
index = 4 # use close price from each ohlcv candle
index = 4 # use close price from each ohlcv candle


def print_chart(exchange, symbol, timeframe):
Expand All @@ -37,16 +37,16 @@ def print_chart(exchange, symbol, timeframe):
series = [x[index] for x in ohlcv]

# print the chart
print("\n" + asciichart.plot(series[-120:], {'height': 20})) # print the chart
print("\n" + asciichart.plot(series[-120:], {'height': 20})) # print the chart

last = ohlcv[len(ohlcv) - 1][index] # last closing price
last = ohlcv[len(ohlcv) - 1][index] # last closing price
return last


print_chart(kraken, 'BTC/USD', '1m')

last = print_chart(kraken, 'BTC/USD', '5m')
print("\n" + kraken.name + " ₿ = $" + str(last) + "\n") # print last closing price
print("\n" + kraken.name + " ₿ = $" + str(last) + "\n") # print last closing price

last = print_chart(yunbi, 'BTC/CNY', '1h')
print("\n" + yunbi.name + " ₿ = CN¥ " + str(last) + "\n") # print last closing price
print("\n" + yunbi.name + " ₿ = CN¥ " + str(last) + "\n") # print last closing price
2 changes: 1 addition & 1 deletion examples/py/fetch-okex-futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# ------------------------------------------------------------------------------

import ccxt # noqa: E402
import ccxt # noqa: E402

# ------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion examples/py/test-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def test(*args):
test_orig(*args, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8080)

except ImportError: # Python 2
except ImportError: # Python 2
from BaseHTTPServer import HTTPServer, test
from SimpleHTTPServer import SimpleHTTPRequestHandler

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
universal=1

[flake8]
ignore = E261, E501, F401, F405
ignore = E501, F401, F405
exclude =
.ropeproject,
.tox,
Expand Down
6 changes: 3 additions & 3 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# ------------------------------------------------------------------------------

import ccxt # noqa: E402
import ccxt # noqa: E402

# ------------------------------------------------------------------------------

Expand All @@ -40,7 +40,7 @@ class Argv(object):


def style(s, style):
return str(s) # style + str (s) + '\033[0m'
return str(s) # style + str (s) + '\033[0m'


def green(s):
Expand Down Expand Up @@ -88,7 +88,7 @@ def dump_error(*args):

def handle_all_unhandled_exceptions(type, value, traceback):
dump_error(yellow(str(type) + ' ' + value + '\n\n' + '\n'.join(format_tb(traceback))))
_exit(1) # unrecoverable crash
_exit(1) # unrecoverable crash


sys.excepthook = handle_all_unhandled_exceptions
Expand Down
6 changes: 3 additions & 3 deletions test/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------------

import ccxt.async as ccxt # noqa: E402
import ccxt.async as ccxt # noqa: E402

# ------------------------------------------------------------------------------

Expand All @@ -41,7 +41,7 @@ class Argv(object):


def style(s, style):
return str(s) # style + str (s) + '\033[0m'
return str(s) # style + str (s) + '\033[0m'


def green(s):
Expand Down Expand Up @@ -90,7 +90,7 @@ def dump_error(*args):
def handle_all_unhandled_exceptions(type, value, traceback):

dump_error(yellow(type, value, '\n\n' + '\n'.join(format_tb(traceback))))
_exit(1) # unrecoverable crash
_exit(1) # unrecoverable crash


sys.excepthook = handle_all_unhandled_exceptions
Expand Down
2 changes: 1 addition & 1 deletion test/test_calculate_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# ------------------------------------------------------------------------------

import ccxt # noqa: E402
import ccxt # noqa: E402

# ------------------------------------------------------------------------------

Expand Down

0 comments on commit 6b221d2

Please sign in to comment.