From a51d0877979c0846b420bee31102d162030f79ca Mon Sep 17 00:00:00 2001 From: Alfonso de la Guarda Reyes Date: Mon, 2 Sep 2013 19:32:26 -0500 Subject: [PATCH] Fixing some typos inside tests and unneeded modules --- gluon/admin.py | 2 +- gluon/cache.py | 2 +- gluon/compileapp.py | 1 - gluon/custom_import.py | 1 - gluon/dal.py | 8 ++++---- gluon/debug.py | 1 - gluon/decoder.py | 2 +- gluon/fileutils.py | 1 - gluon/html.py | 10 +++++----- gluon/languages.py | 1 - gluon/main.py | 1 - gluon/settings.py | 1 - gluon/template.py | 4 ++-- gluon/utils.py | 4 +--- 14 files changed, 15 insertions(+), 24 deletions(-) diff --git a/gluon/admin.py b/gluon/admin.py index abaaf319..b4c93758 100644 --- a/gluon/admin.py +++ b/gluon/admin.py @@ -18,7 +18,7 @@ from fileutils import up, fix_newlines, abspath, recursive_unlink from fileutils import read_file, write_file, parse_version from restricted import RestrictedError from settings import global_settings -from http import HTTP + if not global_settings.web2py_runtime_gae: import site diff --git a/gluon/cache.py b/gluon/cache.py index ab7062d0..221f1989 100644 --- a/gluon/cache.py +++ b/gluon/cache.py @@ -68,7 +68,7 @@ class CacheAbstract(object): def __init__(self, request=None): """ - Paremeters + Parameters ---------- request: the global request object diff --git a/gluon/compileapp.py b/gluon/compileapp.py index fd197044..89365fe2 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -13,7 +13,6 @@ FOR INTERNAL USE ONLY """ import re -import sys import fnmatch import os import copy diff --git a/gluon/custom_import.py b/gluon/custom_import.py index 091aac76..133b9fda 100644 --- a/gluon/custom_import.py +++ b/gluon/custom_import.py @@ -3,7 +3,6 @@ import __builtin__ import os -import re import sys import threading import traceback diff --git a/gluon/dal.py b/gluon/dal.py index 61b3a0a8..4ba211b0 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -10703,7 +10703,7 @@ class Rows(object): def test_all(): """ - >>> if len(sys.argv)<2: db = DAL(\"sqlite://test.db\") + >>> if len(sys.argv)<2: db = DAL("sqlite://test.db") >>> if len(sys.argv)>1: db = DAL(sys.argv[1]) >>> tmp = db.define_table('users',\ Field('stringf', 'string', length=32, required=True),\ @@ -10739,8 +10739,8 @@ def test_all(): Field('name'),\ Field('birth','date'),\ migrate='test_person.table') - >>> person_id = db.person.insert(name=\"Marco\",birth='2005-06-22') - >>> person_id = db.person.insert(name=\"Massimo\",birth='1971-12-21') + >>> person_id = db.person.insert(name='Marco',birth='2005-06-22') + >>> person_id = db.person.insert(name='Massimo',birth='1971-12-21') commented len(db().select(db.person.ALL)) commented 2 @@ -10766,7 +10766,7 @@ def test_all(): Update a single record - >>> me.update_record(name=\"Max\") + >>> me.update_record(name="Max") >>> me.name 'Max' diff --git a/gluon/debug.py b/gluon/debug.py index 525604a6..253cea27 100644 --- a/gluon/debug.py +++ b/gluon/debug.py @@ -10,7 +10,6 @@ License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) """ import logging -import os import pdb import Queue import sys diff --git a/gluon/decoder.py b/gluon/decoder.py index c2b9960e..2b484df1 100644 --- a/gluon/decoder.py +++ b/gluon/decoder.py @@ -1,5 +1,5 @@ import codecs -import encodings + """Caller will hand this library a buffer and ask it to either convert it or auto-detect the type. diff --git a/gluon/fileutils.py b/gluon/fileutils.py index 7c1942da..c451cf2e 100644 --- a/gluon/fileutils.py +++ b/gluon/fileutils.py @@ -7,7 +7,6 @@ Copyrighted by Massimo Di Pierro License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) """ -import sys import storage import os import re diff --git a/gluon/html.py b/gluon/html.py index 1239b448..0d4bea60 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -1961,7 +1961,7 @@ class FORM(DIV): example:: >>> from validators import IS_NOT_EMPTY - >>> form=FORM(INPUT(_name=\"test\", requires=IS_NOT_EMPTY())) + >>> form=FORM(INPUT(_name="test", requires=IS_NOT_EMPTY())) >>> form.xml() '
' @@ -2501,11 +2501,11 @@ def test(): Example: >>> from validators import * - >>> print DIV(A('click me', _href=URL(a='a', c='b', f='c')), BR(), HR(), DIV(SPAN(\"World\"), _class='unknown')).xml() + >>> print DIV(A('click me', _href=URL(a='a', c='b', f='c')), BR(), HR(), DIV(SPAN("World"), _class='unknown')).xml()
click me

World
- >>> print DIV(UL(\"doc\",\"cat\",\"mouse\")).xml() + >>> print DIV(UL("doc","cat","mouse")).xml()
  • doc
  • cat
  • mouse
- >>> print DIV(UL(\"doc\", LI(\"cat\", _class='feline'), 18)).xml() + >>> print DIV(UL("doc", LI("cat", _class='feline'), 18)).xml()
  • doc
  • cat
  • 18
>>> print TABLE(['a', 'b', 'c'], TR('d', 'e', 'f'), TR(TD(1), TD(2), TD(3))).xml()
abc
def
123
@@ -2531,7 +2531,7 @@ def test(): >>> print form.xml()
only alphanumeric!
>>> session={} - >>> form=FORM(INPUT(value=\"Hello World\", _name=\"var\", requires=IS_MATCH('^\w+$'))) + >>> form=FORM(INPUT(value="Hello World", _name="var", requires=IS_MATCH('^\w+$'))) >>> isinstance(form.as_dict(), dict) True >>> form.as_dict(flat=True).has_key("vars") diff --git a/gluon/languages.py b/gluon/languages.py index c20918b4..c8b746c6 100644 --- a/gluon/languages.py +++ b/gluon/languages.py @@ -15,7 +15,6 @@ import re import sys import pkgutil import logging -import marshal from cgi import escape from threading import RLock diff --git a/gluon/main.py b/gluon/main.py index 21669463..d3adf7a0 100644 --- a/gluon/main.py +++ b/gluon/main.py @@ -14,7 +14,6 @@ Contains: if False: import import_all # DO NOT REMOVE PART OF FREEZE PROCESS import gc -import cStringIO import Cookie import os import re diff --git a/gluon/settings.py b/gluon/settings.py index 92962570..0e87ef9d 100644 --- a/gluon/settings.py +++ b/gluon/settings.py @@ -6,7 +6,6 @@ License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) import os import sys -import socket import platform from storage import Storage diff --git a/gluon/template.py b/gluon/template.py index bd68b157..096d5247 100644 --- a/gluon/template.py +++ b/gluon/template.py @@ -845,9 +845,9 @@ def render(content="hello world", 'hello world' >>> render(content='abc') 'abc' - >>> render(content='abc\\'') + >>> render(content='abc\'') "abc'" - >>> render(content='a"\\'bc') + >>> render(content='a"\'bc') 'a"\\'bc' >>> render(content='a\\nbc') 'a\\nbc' diff --git a/gluon/utils.py b/gluon/utils.py index 57e29a4f..289ec0ae 100644 --- a/gluon/utils.py +++ b/gluon/utils.py @@ -11,8 +11,6 @@ This file specifically includes utilities for security. import threading import struct -#import hashlib -#import hmac import uuid import random import time @@ -23,7 +21,7 @@ import logging import socket import base64 import zlib -from types import ModuleType + _struct_2_long_long = struct.Struct('=QQ')