fix #1229 -- replace __file__ with resource_filename()

While we don’t use eggs, this is still good practice we can happily implement.
Merge pull request #1231 from getnikola/destroy-dunderfile

fix #1229 -- replace __file__ with resource_filename()