Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some missing docstrings
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 28, 2015
1 parent 9745619 commit d2ba9ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions nikola/packages/tzlocal/windows_tz.py
@@ -1,3 +1,4 @@
"""Windows timezone names."""
# This file is autogenerated by the get_windows_info.py script
# Do not edit.
win_tz = {
Expand Down
1 change: 0 additions & 1 deletion nikola/plugins/misc/scan_posts.py
Expand Up @@ -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)
Expand Down
11 changes: 8 additions & 3 deletions nikola/rc4.py
@@ -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
Expand All @@ -28,6 +30,7 @@


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

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


def PRGA(S):
"""Run Pseudo-Random Generation Algorithm."""
i = 0
j = 0
while True:
Expand All @@ -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')

Expand Down

0 comments on commit d2ba9ef

Please sign in to comment.