Skip to content
Permalink
Browse files

Add some missing docstrings

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 28, 2015
1 parent 9745619 commit d2ba9ef81a5b44b1f6afced6e3820e51426423fb
Showing with 9 additions and 4 deletions.
  1. +1 −0 nikola/packages/tzlocal/windows_tz.py
  2. +0 −1 nikola/plugins/misc/scan_posts.py
  3. +8 −3 nikola/rc4.py
@@ -1,3 +1,4 @@
"""Windows timezone names."""
# This file is autogenerated by the get_windows_info.py script
# Do not edit.
win_tz = {
@@ -44,7 +44,6 @@ class ScanPosts(PostScanner):

def scan(self):
"""Create list of posts from POSTS and PAGES options."""

seen = set([])
if not self.site.quiet:
print("Scanning posts", end='', file=sys.stderr)
@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
"""
A RC4 encryption library (used for password-protected posts)
---
A RC4 encryption library (used for password-protected posts).
Original RC4 code license:
Copyright (C) 2012 Bo Zhu http://about.bozhu.me
Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,6 +30,7 @@


def KSA(key):
"""Run Key Scheduling Algorithm."""
keylength = len(key)

S = list(range(256))
@@ -41,6 +44,7 @@ def KSA(key):


def PRGA(S):
"""Run Pseudo-Random Generation Algorithm."""
i = 0
j = 0
while True:
@@ -53,16 +57,17 @@ def PRGA(S):


def RC4(key):
"""Generate RC4 keystream."""
S = KSA(key)
return PRGA(S)


def rc4(key, string):
"""Encrypt things.
>>> print(rc4("Key", "Plaintext"))
u/MW6NlArwrT
"""

string.encode('utf8')
key.encode('utf8')

0 comments on commit d2ba9ef

Please sign in to comment.
You can’t perform that action at this time.