From 4dbf332a568a555fcd7302e4b40374bf146ae9aa Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 2 Jan 2018 14:29:37 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E7=A1=AC=E4=BB=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/utils.py | 4 ++++ requirements/mac_requirements.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/common/utils.py b/apps/common/utils.py index 9af801c1c..733f91a18 100644 --- a/apps/common/utils.py +++ b/apps/common/utils.py @@ -327,6 +327,10 @@ def capacity_convert(size, expect='auto', rate=1000): if rate > std_size/rate_ > 1: expect = unit break + + if expect not in rate_mapping: + expect = 'K' + expect_size = std_size / rate_mapping[expect] return expect_size, expect diff --git a/requirements/mac_requirements.txt b/requirements/mac_requirements.txt index 8d00d7608..c7accda00 100644 --- a/requirements/mac_requirements.txt +++ b/requirements/mac_requirements.txt @@ -1 +1 @@ -openssl brew install libtiff libjpeg webp little-cms2 +brew install libtiff libjpeg webp little-cms2 openssl