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
5a84dac2
Commit
5a84dac2
authored
9 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
pylint.
parent
a8fce36a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
diceware/__init__.py
+11
-8
11 additions, 8 deletions
diceware/__init__.py
with
11 additions
and
8 deletions
diceware/__init__.py
+
11
−
8
View file @
5a84dac2
...
...
@@ -13,6 +13,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
diceware -- rememberable passphrases
"""
import
argparse
import
os
import
pkg_resources
...
...
@@ -31,7 +33,7 @@ WORDLISTS_DIR = os.path.abspath(
RE_LANG_CODE
=
re
.
compile
(
'
^[a-zA-Z]{2}$
'
)
#: Special chars inserted on demand
SPECIAL_CHARS
=
"
~!#$%^&*()-=+[]\{}:;
\"
'
<>?/0123456789
"
SPECIAL_CHARS
=
r
"
~!#$%^&*()-=+[]\{}:;\"
'
<>?/0123456789
"
GPL_TEXT
=
(
...
...
@@ -166,7 +168,7 @@ def get_passphrase(wordnum=6, specialsnum=1, delimiter='', lang='en',
if
capitalized
:
words
=
[
x
.
capitalize
()
for
x
in
words
]
result
=
delimiter
.
join
(
words
)
for
x
in
range
(
specialsnum
):
for
_
in
range
(
specialsnum
):
result
=
insert_special_char
(
result
,
rnd
=
rnd
)
return
result
...
...
@@ -185,11 +187,12 @@ def main(args=None):
if
options
.
version
:
print_version
()
raise
SystemExit
(
0
)
print
(
get_passphrase
(
wordnum
=
options
.
num
,
specialsnum
=
options
.
specials
,
delimiter
=
options
.
delimiter
,
capitalized
=
options
.
capitalize
,
fd
=
options
.
infile
,
print
(
get_passphrase
(
wordnum
=
options
.
num
,
specialsnum
=
options
.
specials
,
delimiter
=
options
.
delimiter
,
capitalized
=
options
.
capitalize
,
fd
=
options
.
infile
,
)
)
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