diff options
Diffstat (limited to 'kpov_judge')
-rwxr-xr-x | kpov_judge/kpov_util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kpov_judge/kpov_util.py b/kpov_judge/kpov_util.py index 491e7ce..74b1737 100755 --- a/kpov_judge/kpov_util.py +++ b/kpov_judge/kpov_util.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import itertools import random import string import socket @@ -19,7 +20,9 @@ def alnum_gen(r, l=1): def fortune(r, max_len): all_fortunes = [] - for fortune_file in glob.glob('/usr/share/games/fortunes/*.u8'): + for fortune_file in itertools.chain( + glob.iglob('/usr/share/fortune/*.u8'), + glob.iglob('/usr/share/games/fortunes/*.u8')): f = open(fortune_file) l = f.read().split('\n%\n')[:-1] for i in l: |