Skip to content

Commit

Permalink
Should Fix Python 2 Bug with __Future___
Browse files Browse the repository at this point in the history
  • Loading branch information
super3 committed Aug 10, 2015
1 parent 829ccdb commit cc83a01
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions dataserv/app.py
@@ -1,10 +1,12 @@
# Python 2 Fix
from __future__ import division

import sys
import os.path
import datetime
from flask import make_response
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))


# Import modules
from dataserv.run import app, db
from dataserv.Farmer import Farmer
Expand Down Expand Up @@ -103,11 +105,7 @@ def total():

# return in TB the number
app.config["BYTE_SIZE"] = 1024*1024*128
ratio = float(app.config["BYTE_SIZE"] / (1024*1024*1024*1024)) # bytes / 1 TB
result = float(total_shards * ratio)

print(ratio)
print(result)
result = total_shards * (app.config["BYTE_SIZE"] / (1024*1024*1024*1024)) # bytes / 1 TB

return "{0} TB".format(round(result,2))

Expand Down

0 comments on commit cc83a01

Please sign in to comment.