Commits

Johannes Köster committed 0f30e6d

Allow non-string params.

Comments (0)

Files changed (2)

                 value = wildcards[name]
                 if fail_dynamic and value == dynamic_fill:
                     raise WildcardError(name)
-                return value
+                return str(value)  # convert anything into a str
             except KeyError as ex:
                 if fill_missing:
                     return dynamic_fill

snakemake/rules.py

 
 from snakemake.io import IOFile, _IOFile, protected, temp, dynamic, Namedlist
 from snakemake.io import expand, InputFiles, OutputFiles, Wildcards, Params
-from snakemake.io import apply_wildcards, is_flagged
+from snakemake.io import apply_wildcards, is_flagged, not_iterable
 from snakemake.exceptions import RuleException, IOFileException, WildcardError
 
 __author__ = "Johannes Köster"
                 start = len(newitems)
                 if callable(item):
                     items = item(wildcards_obj)
-                    if isinstance(items, str):
+                    if not_iterable(item):
                         items = [items]
                     for item_ in items:
                         concrete = concretize(item_, wildcards)
                         if ruleio is not None:
                             ruleio[concrete] = item_
                 else:
-                    if isinstance(item, str):
+                    if not_iterable(item):
                         item = [item]
                     for item_ in item:
                         concrete = concretize(item_, wildcards)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.