Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
diceware-debian
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drebs
diceware-debian
Commits
bd625ca9
Commit
bd625ca9
authored
9 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
Start support for config files.
parent
43a2a486
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
diceware/config.py
+36
-0
36 additions, 0 deletions
diceware/config.py
tests/test_config.py
+9
-0
9 additions, 0 deletions
tests/test_config.py
with
45 additions
and
0 deletions
diceware/config.py
0 → 100644
+
36
−
0
View file @
bd625ca9
# diceware -- passphrases to remember
# Copyright (C) 2015 Uli Fouquet
#
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
"""
config -- diceware configuration
`diceware` is configurable via commandline, configuration files and
direct API calls.
"""
import
argparse
try
:
import
configparser
# Python 3.x
except
ImportError
:
# pragma: no cover
import
ConfigParser
as
configparser
# Python 2.x
OPTIONS_DEFAULTS
=
dict
(
num
=
6
,
caps
=
True
,
specials
=
0
,
delimiter
=
""
,
randomsource
=
"
system
"
,
wordlist
=
"
en_8k
"
,
)
This diff is collapsed.
Click to expand it.
tests/test_config.py
0 → 100644
+
9
−
0
View file @
bd625ca9
from
diceware.config
import
OPTIONS_DEFAULTS
class
TestConfigModule
(
object
):
# tests for diceware.config
def
test_defaults
(
self
):
# there is a set of defaults for options available
assert
OPTIONS_DEFAULTS
is
not
None
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment