Skip to content

Commit

Permalink
Removed psutil dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiaanvonmeijenfeldt committed Dec 13, 2018
1 parent 5fe9c1e commit 9b656fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CAT_pack/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import datetime
import os
import psutil
import subprocess
import sys

Expand Down Expand Up @@ -80,9 +79,13 @@ def convert_arguments(args):
def check_memory(GB):
error = False

total_memory = psutil.virtual_memory()[0]

if total_memory / 2 ** 30 < GB:
meminfo_file = '/proc/meminfo'
with open(meminfo_file, 'r') as f:
for line in f:
if line.startswith('MemTotal:'):
total_memory = int(line.split(' ')[-2])

if total_memory / 2 ** 20 < GB:
error = True

return ('{0:.1f}'.format(total_memory / 2 ** 30), error)
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 4.3.1
We removed the psutil dependency.

## 4.3
Prepare now checks whether the RAM of your computer is large enough. If not, not to worry! We have put preconstructed databases online.

Expand Down

0 comments on commit 9b656fa

Please sign in to comment.