Skip to content
Snippets Groups Projects
Commit 5a84dac2 authored by ulif's avatar ulif
Browse files

pylint.

parent a8fce36a
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
"""diceware -- rememberable passphrases
"""
import argparse import argparse
import os import os
import pkg_resources import pkg_resources
...@@ -31,7 +33,7 @@ WORDLISTS_DIR = os.path.abspath( ...@@ -31,7 +33,7 @@ WORDLISTS_DIR = os.path.abspath(
RE_LANG_CODE = re.compile('^[a-zA-Z]{2}$') RE_LANG_CODE = re.compile('^[a-zA-Z]{2}$')
#: Special chars inserted on demand #: Special chars inserted on demand
SPECIAL_CHARS = "~!#$%^&*()-=+[]\{}:;\"'<>?/0123456789" SPECIAL_CHARS = r"~!#$%^&*()-=+[]\{}:;\"'<>?/0123456789"
GPL_TEXT = ( GPL_TEXT = (
...@@ -166,7 +168,7 @@ def get_passphrase(wordnum=6, specialsnum=1, delimiter='', lang='en', ...@@ -166,7 +168,7 @@ def get_passphrase(wordnum=6, specialsnum=1, delimiter='', lang='en',
if capitalized: if capitalized:
words = [x.capitalize() for x in words] words = [x.capitalize() for x in words]
result = delimiter.join(words) result = delimiter.join(words)
for x in range(specialsnum): for _ in range(specialsnum):
result = insert_special_char(result, rnd=rnd) result = insert_special_char(result, rnd=rnd)
return result return result
...@@ -185,11 +187,12 @@ def main(args=None): ...@@ -185,11 +187,12 @@ def main(args=None):
if options.version: if options.version:
print_version() print_version()
raise SystemExit(0) raise SystemExit(0)
print(get_passphrase( print(
wordnum=options.num, get_passphrase(
specialsnum=options.specials, wordnum=options.num,
delimiter=options.delimiter, specialsnum=options.specials,
capitalized=options.capitalize, delimiter=options.delimiter,
fd=options.infile, capitalized=options.capitalize,
fd=options.infile,
) )
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment