What is the significance of "-+-"?
It's just a placeholder, the _cnt variable is in js and thus not accessible in the {{ url_for(..) }}, looking at this now I wonder if it's not worth reverting, the issue was with the lack of | safe
_cnt
{{ url_for(..) }}
| safe
If you can revert then I'd prefer that. This seems very hacky, but it's okay if that's the way it has to be.
rebased
I adjusted the method get_wait_target as my changes weren't needed in fact, but I think I'll keep the change in the waiting template if that's ok with you.
get_wait_target
Why is it that you're trying again on exception? If there's a specific reason, please add a comment in the code since this is strange behavior when unexplained. :stuck_out_tongue:
It could be cleaner if you left out count from the url_for function call, and then just appended the count argument with javascript afterwards.
count
url_for
So you could do something like this (untested):
var _url = '{{ url_for("wait_task", taskid=task.id, prev=prev) | safe }}'; // This line below is probably useless since you are always providing parameters `url_for` function, but I figured I'd add it. _url += _url.contains('?') ? '&' : '?'; _url += 'count=' + _cnt;
@pingou a few small comments that are not blockers, but suggestions. +1 to merge.
Let's give it a try :)
I'll add a comment, somehow when running the tests, I was getting into errors which are likely due to a race-condition between files being created and files being removed. Not quite sure what's going on, but this fixes it despite being ugly :(
5 new commits added
@pingou feel free to merge this after you add the comment in tests/__init__.py.
tests/__init__.py
Reword to: Sometimes there is a race condition that makes deleting the folder fail during the first attempt. So just try a second time if that's the case.
Small rewording request. +1
reworded, rebased, merging :)
Pull-Request has been merged by pingou