Changeset 4355:486ba3de1453 in livinglogic.python.xist

Show
Ignore:
Timestamp:
02/24/11 11:30:19 (8 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Tags:
rel-3-17
Message:

Use pkg_resources to find ul4.js.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • test/test_ul4.py

    r4354 r4355  
    1212from __future__ import division 
    1313 
    14 import sys, os, re, datetime, StringIO, json, contextlib, tempfile, collections, shutil, subprocess 
     14import sys, os, re, datetime, StringIO, json, contextlib, tempfile, collections, shutil, subprocess, pkg_resources 
    1515 
    1616import py.test 
     
    9696            f.write(js.encode("utf-8")) 
    9797            f.flush() 
    98             result = os.popen("d8 src/ll/xist/data/js/ul4.js {}".format(f.name), "rb").read() 
     98            result = os.popen("d8 {} {}".format(pkg_resources.resource_filename("ll.xist", "data/"), f.name), "rb").read() 
    9999        result = result.decode("utf-8")[:-1] # Drop the "\n" 
    100100        # Check if we have an exception