Changeset 11820 for main


Ignore:
Timestamp:
24 Sep 2014, 15:35:31 (10 years ago)
Author:
uli
Message:

Use coool expression to turn negative values into positives.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r11819 r11820  
    329329            if isinstance(max_val, float):
    330330                # percents
    331                 if max_val < 0.0:
    332                     max_val += 100.0
     331                max_val %= 100.0
    333332                if mem_val.percent > max_val:
    334333                    return False
    335334            else:
    336335                # number of bytes
    337                 if max_val < 0:
    338                     max_val += mem_val.total
     336                max_val %= mem_val.total
    339337                if mem_val.used > max_val:
    340338                    return False
Note: See TracChangeset for help on using the changeset viewer.