authors: yes
files: yes
ignored: COPYING | README | .update-copyright.conf | .git* | */.gitignore |
- *.pyc
+ quizzes/ | *.pyc
[copyright]
short: {project} comes with ABSOLUTELY NO WARRANTY and is licensed under the GNU General Public License.
class Quiz (list):
- def __init__(self, introduction=None, questions=None, path=None,
- encoding=None):
- self.introduction = introduction
+ def __init__(self, questions=None, path=None, encoding=None,
+ copyright=None, introduction=None):
if questions is None:
questions = []
super(Quiz, self).__init__(questions)
self.path = path
self.encoding = encoding
+ self.copyright = copyright
+ self.introduction = introduction
def _open(self, mode='r', path=None, encoding=None):
if path:
if version != __version__:
raise NotImplementedError('upgrade from {} to {}'.format(
version, __version__))
+ self.copyright = data.get('copyright', None)
self.introduction = data.get('introduction', None)
for state in data['questions']:
question_class_name = state.pop('class', 'Question')
state['class'] = type(question).__name__
data = {
'version': __version__,
+ 'copyright': self.copyright,
'introduction': self.introduction,
'questions': questions,
}
self._reset()
print(self.question.format_help())
+ def do_copyright(self, arg):
+ "Print the quiz copyright notice"
+ if self.ui.quiz.copyright:
+ print('\n'.join(self.ui.quiz.copyright))
+ else:
+ print(self.ui.quiz.copyright)
+
def do_help(self, arg):
'List available commands with "help" or detailed help with "help cmd"'
if not arg:
{
"version": "0.1",
+ "copyright": [
+ "Copyright (C) 2013 W. Trevor King <wking@tremily.us>",
+ "",
+ "This file is part of quizzer.",
+ "",
+ "quizzer is free software: you can redistribute it and/or modify it under the",
+ "terms of the GNU General Public License as published by the Free Software",
+ "Foundation, either version 3 of the License, or (at your option) any later",
+ "version.",
+ "",
+ "quizzer is distributed in the hope that it will be useful, but WITHOUT ANY",
+ "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR",
+ "A PARTICULAR PURPOSE. See the GNU General Public License for more details.",
+ "",
+ "You should have received a copy of the GNU General Public License along with",
+ "quizzer. If not, see <http://www.gnu.org/licenses/>."
+ ],
"introduction": "Test your knowledge of the Git version control system.",
"questions": [
{
{
"version": "0.1",
+ "copyright": [
+ "Copyright (C) 2013 W. Trevor King <wking@tremily.us>",
+ "",
+ "This file is part of quizzer.",
+ "",
+ "quizzer is free software: you can redistribute it and/or modify it under the",
+ "terms of the GNU General Public License as published by the Free Software",
+ "Foundation, either version 3 of the License, or (at your option) any later",
+ "version.",
+ "",
+ "quizzer is distributed in the hope that it will be useful, but WITHOUT ANY",
+ "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR",
+ "A PARTICULAR PURPOSE. See the GNU General Public License for more details.",
+ "",
+ "You should have received a copy of the GNU General Public License along with",
+ "quizzer. If not, see <http://www.gnu.org/licenses/>."
+ "",
+ "The quotations from \"Monty Python and the Holy Grail\" are copyright someone",
+ "else (possibly Freeway Cam (UK) Limited?), but the quotes are short and",
+ "should fall under \"fair use\"."
+ ],
"introduction": "Test your knowledge of Monty Python and the Holy Grail!",
"questions": [
{
{
"version": "0.1",
+ "copyright": [
+ "Copyright (C) 2013 W. Trevor King <wking@tremily.us>",
+ "",
+ "This file is part of quizzer.",
+ "",
+ "quizzer is free software: you can redistribute it and/or modify it under the",
+ "terms of the GNU General Public License as published by the Free Software",
+ "Foundation, either version 3 of the License, or (at your option) any later",
+ "version.",
+ "",
+ "quizzer is distributed in the hope that it will be useful, but WITHOUT ANY",
+ "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR",
+ "A PARTICULAR PURPOSE. See the GNU General Public License for more details.",
+ "",
+ "You should have received a copy of the GNU General Public License along with",
+ "quizzer. If not, see <http://www.gnu.org/licenses/>."
+ ],
"introduction": "Test your knowledge of the POSIX shell.",
"questions": [
{
{
"version": "0.1",
+ "copyright": [
+ "Copyright (C) 2013 W. Trevor King <wking@tremily.us>",
+ "",
+ "This file is part of quizzer.",
+ "",
+ "quizzer is free software: you can redistribute it and/or modify it under the",
+ "terms of the GNU General Public License as published by the Free Software",
+ "Foundation, either version 3 of the License, or (at your option) any later",
+ "version.",
+ "",
+ "quizzer is distributed in the hope that it will be useful, but WITHOUT ANY",
+ "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR",
+ "A PARTICULAR PURPOSE. See the GNU General Public License for more details.",
+ "",
+ "You should have received a copy of the GNU General Public License along with",
+ "quizzer. If not, see <http://www.gnu.org/licenses/>."
+ ],
"introduction": "Test your knowledge of POSIX utilities.",
"questions": [
{