Skip to content

Commit

Permalink
credited sysexits.h (#55); magic numbers improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
GijsTimmers committed Jan 6, 2015
1 parent b09bad4 commit 5354165
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 deletions communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,16 @@ def print_generic_balk(self, percentage, style, color, stop_color, stop_style):
percentagefloat = float(percentage)
percentagestring = str(percentage)

lengteVanBalk = 10.0
lengteVanBalkfloat = 10.0
lengteVanBalkint = 10
lengteVanRuimteVoorPercentages = 3

aantalStreepjesObvPercentage = int(round(percentagefloat/lengteVanBalk))
aantalStreepjesObvPercentage = int(round(percentagefloat/lengteVanBalkfloat))
print style + "[" + color + \
"=" * aantalStreepjesObvPercentage + stop_color + \
" " * (10-aantalStreepjesObvPercentage) + \
" " * (lengteVanBalkint-aantalStreepjesObvPercentage) + \
"] [" + \
" " * (3 - len(percentagestring)) + \
" " * (lengteVanRuimteVoorPercentages - len(percentagestring)) + \
color + percentagestring + "%" + \
stop_color + "]" + stop_style

Expand Down
4 changes: 4 additions & 0 deletions tools/errorcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
## CA 94042, USA.



## Derived from /usr/include/sysexits.h


## Error numbers begin at BASE to reduce the possibility of
## clashing with other exit statuses that random programs may
## already return. The meaning of the codes is approximately
Expand Down

0 comments on commit 5354165

Please sign in to comment.