diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-02-12 22:50:45 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-02-12 22:50:45 +0200 |
commit | eb51163185fdeaf50646d0ae2876c94c230fa61a (patch) | |
tree | cd2065edcb904cfd116226e9f3bc439416139419 /interpreter.py | |
parent | 51827d4484845432588f850b24245d22b1d9c9f0 (diff) | |
download | meson-eb51163185fdeaf50646d0ae2876c94c230fa61a.zip meson-eb51163185fdeaf50646d0ae2876c94c230fa61a.tar.gz meson-eb51163185fdeaf50646d0ae2876c94c230fa61a.tar.bz2 |
Fix the remaining custom install dirs.
Diffstat (limited to 'interpreter.py')
-rw-r--r-- | interpreter.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/interpreter.py b/interpreter.py index 1e74f40..3ca425f 100644 --- a/interpreter.py +++ b/interpreter.py @@ -293,6 +293,9 @@ class Data(InterpreterObject): if not isinstance(kwsource, list): kwsource = [kwsource] self.sources += kwsource + self.custom_install_dir = kwargs.get('install_dir', None) + if self.custom_install_dir is not None and not isinstance(self.custom_install_dir, str): + raise InterpreterException('Custom_install_dir must be a string.') def get_subdir(self): return self.subdir @@ -300,21 +303,30 @@ class Data(InterpreterObject): def get_sources(self): return self.sources + def get_custom_install_dir(self): + return self.custom_install_dir + class Man(InterpreterObject): def __init__(self, sources, kwargs): InterpreterObject.__init__(self) self.sources = sources self.validate_sources() - if len(kwargs) > 0: - raise InvalidArguments('Man function takes no keyword arguments.') - + if len(kwargs) > 1: + raise InvalidArguments('Man function takes at most one keyword arguments.') + self.custom_install_dir = kwargs.get('install_dir', None) + if self.custom_install_dir is not None and not isinstance(self.custom_install_dir, str): + raise InterpreterException('Custom_install_dir must be a string.') + def validate_sources(self): for s in self.sources: num = int(s.split('.')[-1]) if num < 1 or num > 8: raise InvalidArguments('Man file must have a file extension of a number between 1 and 8') + def get_custom_install_dir(self): + return self.custom_install_dir + def get_sources(self): return self.sources |