diff options
Diffstat (limited to 'master/autotua/process/validate.py')
-rw-r--r-- | master/autotua/process/validate.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/master/autotua/process/validate.py b/master/autotua/process/validate.py deleted file mode 100644 index dcbc201..0000000 --- a/master/autotua/process/validate.py +++ /dev/null @@ -1,34 +0,0 @@ -# vim: set sw=4 sts=4 et : -# Copyright: 2008 Gentoo Foundation -# Author(s): Nirbheek Chauhan <nirbheek.chauhan@gmail.com> -# License: GPL-2 -# -# Immortal lh! -# - -from datetime import datetime -import const - -def is_stage(stage): - if stage not in const.STAGES: - raise Exception(const.VERRORS['invalid_stage'] % stage) - return True - -def is_arch(arch): - if arch not in const.ARCHS['all']: - raise Exception(const.VERRORS['invalid_arch'] % i) - return True - -def is_type(type): - if type not in const.STAGE_TYPE: - raise Exception(const.VERRORS['invalid_type'] % type) - return True - -def is_release(release): - year, state = release.split('_', 1) - try: - if int(year.split('.', 1)[0]) > datetime.now().year: - raise Exception(const.VERRORS['invalid_release'] % release) - except: - raise Exception(const.VERRORS['invalid_release'] % release) - return True |