From: Steven Tobin Date: Sat, 17 Jan 2015 19:19:28 +0000 (+0000) Subject: fixed pep8 issues X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=017d2bb819fb1d22ada7023410cc8a6a6a50bc32;p=redacted-XKCD-password-generator.git fixed pep8 issues --- diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index 4f40158..17f08d9 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -95,6 +95,7 @@ def validate_options(parser, options, args): "not exist.\n") sys.exit(1) + def locate_wordfile(): static_default = os.path.join( os.path.dirname(os.path.abspath(__file__)), @@ -254,52 +255,51 @@ def main(): parser = optparse.OptionParser(usage) parser.add_option( - "-w", "--wordfile", - dest="wordfile", default=None, metavar="WORDFILE", - help=( - "Specify that the file WORDFILE contains" - " the list of valid words from which to generate passphrases.")) + "-w", "--wordfile", + dest="wordfile", default=None, metavar="WORDFILE", + help=( + "Specify that the file WORDFILE contains the list of valid words" + " from which to generate passphrases.")) parser.add_option( - "--min", - dest="min_length", type="int", default=5, metavar="MIN_LENGTH", - help="Generate passphrases containing at least MIN_LENGTH words.") + "--min", + dest="min_length", type="int", default=5, metavar="MIN_LENGTH", + help="Generate passphrases containing at least MIN_LENGTH words.") parser.add_option( - "--max", - dest="max_length", type="int", default=9, metavar="MAX_LENGTH", - help="Generate passphrases containing at most MAX_LENGTH words.") + "--max", + dest="max_length", type="int", default=9, metavar="MAX_LENGTH", + help="Generate passphrases containing at most MAX_LENGTH words.") parser.add_option( - "-n", "--numwords", - dest="numwords", type="int", default=6, metavar="NUM_WORDS", - help="Generate passphrases containing exactly NUM_WORDS words.") + "-n", "--numwords", + dest="numwords", type="int", default=6, metavar="NUM_WORDS", + help="Generate passphrases containing exactly NUM_WORDS words.") parser.add_option( - "-i", "--interactive", - action="store_true", dest="interactive", default=False, - help=( - "Generate and output a passphrase," - " query the user to accept it," - " and loop until one is accepted.")) + "-i", "--interactive", + action="store_true", dest="interactive", default=False, + help=( + "Generate and output a passphrase, query the user to accept it," + " and loop until one is accepted.")) parser.add_option( - "-v", "--valid_chars", - dest="valid_chars", default=".", metavar="VALID_CHARS", - help=( - "Limit passphrases to only include words matching" - " the regex pattern VALID_CHARS (e.g. '[a-z]').")) + "-v", "--valid_chars", + dest="valid_chars", default=".", metavar="VALID_CHARS", + help=( + "Limit passphrases to only include words matching the regex" + " pattern VALID_CHARS (e.g. '[a-z]').")) parser.add_option( - "-V", "--verbose", - action="store_true", dest="verbose", default=False, - help="Report various metrics for given options.") + "-V", "--verbose", + action="store_true", dest="verbose", default=False, + help="Report various metrics for given options.") parser.add_option( - "-a", "--acrostic", - dest="acrostic", default=False, - help="Generate passphrases with an acrostic matching ACROSTIC.") + "-a", "--acrostic", + dest="acrostic", default=False, + help="Generate passphrases with an acrostic matching ACROSTIC.") parser.add_option( - "-c", "--count", - dest="count", type="int", default=1, metavar="COUNT", - help="Generate COUNT passphrases.") + "-c", "--count", + dest="count", type="int", default=1, metavar="COUNT", + help="Generate COUNT passphrases.") parser.add_option( - "-d", "--delimiter", - dest="delim", default=" ", metavar="DELIM", - help="Separate words within a passphrase with DELIM.") + "-d", "--delimiter", + dest="delim", default=" ", metavar="DELIM", + help="Separate words within a passphrase with DELIM.") (options, args) = parser.parse_args() validate_options(parser, options, args)