|
Revision 260, 1.2 KB
(checked in by trivoallan, 4 years ago)
|
|
cleverbox :
- Added licence information to all project's file. Fixes #28
- Fixed version number in O.4's setup.py
|
| Line | |
|---|
| 1 | # This file is part of the "Cleverbox" program. |
|---|
| 2 | # |
|---|
| 3 | # Cleverbox is free software: you can redistribute it and/or modify |
|---|
| 4 | # it under the terms of the GNU General Public License as published by |
|---|
| 5 | # the Free Software Foundation, either version 3 of the License, or |
|---|
| 6 | # (at your option) any later version. |
|---|
| 7 | # |
|---|
| 8 | # Cleverbox is distributed in the hope that it will be useful, |
|---|
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | # GNU General Public License for more details. |
|---|
| 12 | # |
|---|
| 13 | # You should have received a copy of the GNU General Public License |
|---|
| 14 | # along with Cleverbox. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 15 | # |
|---|
| 16 | # Copyright 2008, Tristan Rivoallan |
|---|
| 17 | |
|---|
| 18 | def collect(input_specs): |
|---|
| 19 | |
|---|
| 20 | # Collected info to be returned to caller |
|---|
| 21 | collected = {} |
|---|
| 22 | |
|---|
| 23 | print |
|---|
| 24 | |
|---|
| 25 | for input_name in input_specs: |
|---|
| 26 | |
|---|
| 27 | # For clarity |
|---|
| 28 | input_spec = input_specs[input_name] |
|---|
| 29 | long_name = input_spec[0] |
|---|
| 30 | description = input_spec[1] |
|---|
| 31 | default = input_spec[2] |
|---|
| 32 | |
|---|
| 33 | # Require input from user |
|---|
| 34 | print description |
|---|
| 35 | print |
|---|
| 36 | collected[input_name] = raw_input(' %s [%s]> ' % (long_name, default)).strip() or default |
|---|
| 37 | print |
|---|
| 38 | |
|---|
| 39 | return collected |
|---|