Commit 1dab3f29 authored by Devaev Maxim's avatar Devaev Maxim

Validator for string list

parent 7108957e
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import re
##### Exceptions ##### ##### Exceptions #####
class ValidatorError(Exception) : class ValidatorError(Exception) :
pass pass
...@@ -22,3 +25,6 @@ def validRange(arg, valid_args_list) : ...@@ -22,3 +25,6 @@ def validRange(arg, valid_args_list) :
raise ValidatorError("Argument \"%s\" not in range %s" % (arg, str(valid_args_list))) raise ValidatorError("Argument \"%s\" not in range %s" % (arg, str(valid_args_list)))
return arg return arg
def validList(arg) :
return re.split(r"[,\t ]+", str(arg))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment