paul@100 | 1 | #!/usr/bin/env python |
paul@100 | 2 | |
paul@100 | 3 | """ |
paul@100 | 4 | Directory output context. |
paul@100 | 5 | |
paul@100 | 6 | Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> |
paul@100 | 7 | |
paul@100 | 8 | This program is free software; you can redistribute it and/or modify it under |
paul@100 | 9 | the terms of the GNU General Public License as published by the Free Software |
paul@100 | 10 | Foundation; either version 3 of the License, or (at your option) any later |
paul@100 | 11 | version. |
paul@100 | 12 | |
paul@100 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT |
paul@100 | 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
paul@100 | 15 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
paul@100 | 16 | details. |
paul@100 | 17 | |
paul@100 | 18 | You should have received a copy of the GNU General Public License along with |
paul@100 | 19 | this program. If not, see <http://www.gnu.org/licenses/>. |
paul@100 | 20 | """ |
paul@100 | 21 | |
paul@100 | 22 | from moinformat.output.common import Output |
paul@104 | 23 | from moinformat.utils.directory import Directory |
paul@100 | 24 | |
paul@104 | 25 | class DirectoryOutput(Output, Directory): |
paul@100 | 26 | |
paul@100 | 27 | "A directory output context." |
paul@100 | 28 | |
paul@104 | 29 | name = "directory" |
paul@100 | 30 | |
paul@104 | 31 | def __init__(self, parameters=None): |
paul@100 | 32 | |
paul@104 | 33 | "Initialise the context with the given 'parameters'." |
paul@100 | 34 | |
paul@104 | 35 | if not parameters or not parameters.has_key("filename"): |
paul@104 | 36 | raise ValueError, parameters |
paul@100 | 37 | |
paul@104 | 38 | Output.__init__(self, parameters) |
paul@104 | 39 | Directory.__init__(self, parameters["filename"]) |
paul@100 | 40 | |
paul@104 | 41 | output = DirectoryOutput |
paul@100 | 42 | |
paul@100 | 43 | # vim: tabstop=4 expandtab shiftwidth=4 |