From 33b208e091c94b92648d54cf0ade3e68fde961e9 Mon Sep 17 00:00:00 2001 From: Daniele Bonadiman Date: Wed, 14 May 2014 20:26:57 +0200 Subject: [PATCH] added docstring pylint 10/10 --- wordlist/_util.py | 10 ++++++++++ wordlist/wordlist.py | 26 +++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/wordlist/_util.py b/wordlist/_util.py index e1d4e06..bdb0778 100644 --- a/wordlist/_util.py +++ b/wordlist/_util.py @@ -1,3 +1,9 @@ +""".util +is a private module containing utility +used for the actual implementation of +the wordlist generator +""" + from collections import OrderedDict @@ -31,5 +37,9 @@ def parse_charset(charset): def scan_pattern(string): + """ + Scans the pattern in the form @@@a@@ returning an OrderedDict + containing the position of the fixed characters. + """ res = OrderedDict([(i, x) for i, x in enumerate(string) if x != '@']) return res diff --git a/wordlist/wordlist.py b/wordlist/wordlist.py index b30fea9..b6475d7 100644 --- a/wordlist/wordlist.py +++ b/wordlist/wordlist.py @@ -1,4 +1,4 @@ - +# -*- coding: utf-8 -*- ############################################ # # # Wordlist generator, creates dictionaries # @@ -7,6 +7,30 @@ # dbonadiman. # # # ############################################ +"""Wordlist + +Generates all possible permutations of a given charset. + +Usage: +>>>import wordlist +>>>generator = wordlist.Generator('ab') +>>>for each in generator.generate(1, 2): +... print(each) +a +b +aa +ab +ba +bb + +>>>import wordlist +>>>generator = wordlist.Generator('ab') +>>>for each in generator.generate_with_pattern('@a'): +... print(each) +aa +ba +""" + from __future__ import print_function from itertools import product