Using a source file, "Hello.java" as input:
/// @export "Hello class"
class Hello {
/// @export "method1"
public void meth1() {}
/// @export "method2"
public void meth2() {}
/// @end
}
And a hello.txt with:
Method 2 is the most important:
{{ d['Hello.java|idio']['method2'] }}
It calls Method 1
{{ d['Hello.java|idio']['method1'] }}
This is the fundamental definition of the Hello class
{{ d['Hello.java|pyg'] }}
I get the following stacktrace:
batch id is 2
sorting 3 documents into run order, there are 2 total dependencies
ratio of dependencies to documents is 0.7
Error occurred while running hello.txt|jinja
Original traceback:
dexy.exe : File "C:\Python27\lib\site-packages\dexy\artifact.py", line 288, in run
At line:1 char:5
+ dexy <<<< 2>&1 > err.log
+ CategoryInfo : NotSpecified: ( File "C:\Pyth...ine 288, in run:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
filter_instance.process()
File "C:\Python27\lib\site-packages\dexy\filters\templating_filters.py", line 150, in process
self.handle_jinja_exception(e)
File "C:\Python27\lib\site-packages\dexy\filters\templating_filters.py", line 133, in handle_jinja_exception
raise JinjaFilterException("\n".join(result))
Traceback (most recent call last):
File "C:\Python27\Scripts\dexy-script.py", line 9, in <module>
load_entry_point('dexy==0.5.1', 'console_scripts', 'dexy')()
File "C:\Python27\lib\site-packages\dexy\commands.py", line 18, in run
args.parse_and_run_command(sys.argv[1:], MOD, default_command=Constants.DEFAULT_COMMAND)
File "C:\Python27\lib\site-packages\modargs\args.py", line 360, in parse_and_run_command
command_module(mod, command, options)
File "C:\Python27\lib\site-packages\modargs\args.py", line 280, in command_module
return function(**options)
File "C:\Python27\lib\site-packages\dexy\commands.py", line 98, in dexy_command
controller = run_dexy(locals())
File "C:\Python27\lib\site-packages\dexy\commands.py", line 107, in run_dexy
controller.run()
File "C:\Python27\lib\site-packages\dexy\controller.py", line 77, in run
self.docs = [doc.run() for doc in self.docs]
File "C:\Python27\lib\site-packages\dexy\document.py", line 346, in run
artifact.run()
File "C:\Python27\lib\site-packages\dexy\artifact.py", line 300, in run
raise e
dexy.filters.templating_filters.JinjaFilterException: There is a problem with hello.txt|jinja
A problem was detected at line 10 of artifacts\b07606b9ed3534f0b6199698a9d88bb8.txt
WARNING: line number may not be accurate, check elsewhere in your file if the excerpt does not contain the undefined it
em from the stack trace.
==================================================
This is the fundamental definition of the Hello class
>>> {{ d['hello.java|pyg'] }}
==================================================
The error is: 'unicode object' has no attribute 'method2'
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\dexy\filters\templating_filters.py", line 148, in process
template.stream(template_data).dump(self.artifact.filepath())
File "C:\Python27\lib\site-packages\jinja2\environment.py", line 1072, in dump
fp.writelines(iterable)
File "C:\Python27\lib\site-packages\jinja2\environment.py", line 1116, in next
return self._next()
File "C:\Python27\lib\site-packages\jinja2\environment.py", line 918, in generate
yield self.environment.handle_exception(exc_info, True)
File "<template>", line 10, in top-level template code
UndefinedError: 'unicode object' has no attribute 'method2'
While using this file
### @export "Hello class"
class Hello {
### @export "method1"
public void meth1() {}
### @export "method2"
public void meth2() {}
### @end
}
Provides the expected results.
Here's my .dexy file
{
"*.txt|jinja" : {
"inputs" : ["Hello.java|pyg", "Hello.java|idio"]
}
}