-# -*- coding: iso-8859-1 -*-
"""A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
self.wordchars = ('abcdfeghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_')
if self.posix:
- self.wordchars += ('ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'
- 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ')
+ self.wordchars += ('ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'
+ 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ')
self.whitespace = ' \t\r\n'
self.whitespace_split = False
self.quotes = '\'"'
-# regression test for SAX 2.0 -*- coding: iso-8859-1 -*-
+# regression test for SAX 2.0
# $Id$
from xml.sax import make_parser, ContentHandler, \
"<Donald Duck & Co>")
def test_escape_extra(self):
- self.assertEquals(escape("Hei på deg", {"å" : "å"}),
+ self.assertEquals(escape("Hei på deg", {"å" : "å"}),
"Hei på deg")
# ===== unescape
"<Donald Duck & Co>")
def test_unescape_extra(self):
- self.assertEquals(unescape("Hei på deg", {"å" : "å"}),
+ self.assertEquals(unescape("Hei på deg", {"å" : "å"}),
"Hei på deg")
def test_unescape_amp_extra(self):
-# -*- coding: iso-8859-1 -*-
import unittest
import os, sys, io
import shlex
foo\ bar|foo|\|bar|
foo#bar\nbaz|foobaz|
:-) ;-)|:|-|)|;|-|)|
-áéíóú|á|é|í|ó|ú|
+áéíóú|á|é|í|ó|ú|
"""
posix_data = r"""x|x|
foo\ bar|foo bar|
foo#bar\nbaz|foo|baz|
:-) ;-)|:-)|;-)|
-áéíóú|áéíóú|
+áéíóú|áéíóú|
"""
class ShlexTest(unittest.TestCase):
-# -*- coding: iso-8859-1 -*-
""" Test script for the Unicode implementation.
Written by Marc-Andre Lemburg (mal@lemburg.com).
self.assertTrue("b0".isidentifier())
self.assertTrue("bc".isidentifier())
self.assertTrue("b_".isidentifier())
- self.assertTrue("µ".isidentifier())
+ self.assertTrue("µ".isidentifier())
self.assertFalse(" ".isidentifier())
self.assertFalse("[".isidentifier())
- self.assertFalse("©".isidentifier())
+ self.assertFalse("©".isidentifier())
self.assertFalse("0".isidentifier())
def test_isprintable(self):