Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/NVIDIA/DIGITS
Browse files Browse the repository at this point in the history
  • Loading branch information
moconnor725 committed Mar 23, 2015
2 parents 3a69ea9 + c85b50d commit 0c1ec6d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion digits-devserver
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.

import sys
Expand Down
2 changes: 1 addition & 1 deletion digits-walkthrough
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.

import os
Expand Down
2 changes: 1 addition & 1 deletion digits/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.

import os
Expand Down
7 changes: 7 additions & 0 deletions digits/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ def sizeof_fmt(size, suffix='B'):
Arguments:
size -- size in bytes
"""
try:
size = int(size)
except ValueError:
return None
if size <= 0:
return '0 %s' % suffix

size_name = ('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
i = int(math.floor(math.log(size,1024)))
if i >= len(size_name):
Expand Down
2 changes: 1 addition & 1 deletion tools/create_db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.

import sys
Expand Down
2 changes: 1 addition & 1 deletion tools/parse_folder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.

import sys
Expand Down
2 changes: 1 addition & 1 deletion tools/resize_image.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.

import sys
Expand Down

0 comments on commit 0c1ec6d

Please sign in to comment.