Browse files

Detect strings of class unicode in ifinput handling.

  • Loading branch information...
1 parent 3657f67 commit 1855abec52bc58639f3046a7eafb3e225b01a7ae @ananelson ananelson committed Feb 22, 2011
Showing with 4 additions and 7 deletions.
  1. +4 −7 dexy/controller.py
View
11 dexy/controller.py
@@ -170,17 +170,12 @@ def parse_doc(input_directive, args = {}):
files = glob.glob(glob_string)
nofiles = len(files) == 0
- in_proj_root = self.path == '.'
+ in_proj_root = (self.path == '.')
not_wildcard = glob_string.find("*") < 0
if nofiles and virtual:
files = [glob_string]
- # If we mention a specific file in .dexy it should be there...
- if nofiles and not virtual and in_proj_root and not_wildcard and False:
- # TODO raise specific class of Exception
- raise Exception("file %s not found!" % glob_string)
-
for f in files:
create = True
@@ -206,9 +201,11 @@ def parse_doc(input_directive, args = {}):
# will depend on the specified input.
if args.has_key('ifinput'):
log.debug(f)
- if isinstance(args['ifinput'], str):
+ if isinstance(args['ifinput'], str) or isinstance(args['ifinput'], unicode):
ifinputs = [args['ifinput']]
else:
+ log.debug("treating input %s as iterable. class: %s" % (
+ args['ifinput'], args['ifinput'].__class__.__name__))
ifinputs = args['ifinput']
for s in ifinputs:

0 comments on commit 1855abe

Please sign in to comment.