diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-01-28 11:39:36 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-01-28 11:39:36 -0500 |
commit | 7bbefa1fcc9a6006953eb0a79049ece9f05985de (patch) | |
tree | 8fa1d24a0f6411b7455e76fd87b659049690077f /src/beautifulsoup/util.py | |
parent | 692fe5201d5dec15a3598578a6f403e67802de0d (diff) |
Moved everything into the top-level directory and got rid of buildout.
Diffstat (limited to 'src/beautifulsoup/util.py')
-rw-r--r-- | src/beautifulsoup/util.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/beautifulsoup/util.py b/src/beautifulsoup/util.py deleted file mode 100644 index 693a7e2..0000000 --- a/src/beautifulsoup/util.py +++ /dev/null @@ -1,29 +0,0 @@ -# Helper functions and mixin classes for Beautiful Soup - -import types -try: - set -except NameError: - from sets import Set as set - -def isList(l): - """Convenience method that works with all 2.x versions of Python - to determine whether or not something is listlike.""" - return ((hasattr(l, '__iter__') and not isString(l)) - or (type(l) in (types.ListType, types.TupleType))) - -def isString(s): - """Convenience method that works with all 2.x versions of Python - to determine whether or not something is stringlike.""" - try: - return isinstance(s, unicode) or isinstance(s, basestring) - except NameError: - return isinstance(s, str) - -def buildSet(args=None): - """Turns a list or a string into a set.""" - if isinstance(args, str): - return set([args]) - if args is None: - return set() - return set(args) |