Skip to content

Commit 42ba895

Browse files
committed
python3 compability
1 parent 7b70a23 commit 42ba895

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Setup
3939
-----
4040
Install required packages
4141
::
42-
$ sudo apt-get install git sqlite3 mongodb gunicorn tmux python-pip python-dev libxml2-dev libxslt1-dev zlib1g-dev
42+
$ sudo apt-get install git sqlite3 mongodb tmux python-pip python-dev libxml2-dev libxslt1-dev zlib1g-dev
4343
$ git clone https://github.com/Storj/driveshare-graph.git
4444
$ cd driveshare-graph
4545
$ pip install -r requirements.txt
@@ -58,7 +58,7 @@ Deploy
5858
Use gunicorn
5959
::
6060
$ tmux attach -t driveshare-graph
61-
$ cd driveshare-graph/driveshare-graph
61+
$ cd driveshare-graph/driveshare_graph
6262
$ gunicorn -b 0.0.0.0:80 --workers=4 app:app
6363
Detach the tmux session after running gunicorn.
6464

driveshare_graph/minmax.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def minmax_chart(collection):
8787
dates = []
8888
min_counts = []
8989
max_counts = []
90-
for key in minmax_dict.iterkeys():
90+
for key in minmax_dict.keys():
9191
dates.append(key)
9292
dates.sort()
9393
for date in dates:

driveshare_graph/uptime.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def init_farmers_table(conn, cursor, collection):
5252
uptimes[btc_address] = 0
5353
previous_time = doc_time
5454

55-
for key, value in first_dates.iteritems():
55+
for key, value in first_dates.items():
5656
address = key
5757
first_date = value
5858
last_date = last_dates[key]
@@ -239,7 +239,7 @@ def uptime_histogram(cursor, collection): # pragma: no cover
239239
xrange=(0, 100),
240240
disable_xml_declaration=True)
241241
distribution = uptime_distribution(cursor, collection)
242-
for key, value in distribution.iteritems():
242+
for key, value in distribution.items():
243243
bucket = '%i%% to %i%%' % (key, key+5)
244244
uptime_histogram.add(bucket, [(value, key, key+5)])
245245
return uptime_histogram

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ flask==0.10.1
22
pymongo==3.0.3
33
pygal==2.0.7
44
simplejson==3.8.1
5-
5+
gunicorn>=19.4.5
6+
scrapy>=1.0.5

0 commit comments

Comments
 (0)