Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)
Fix sys.path so that the core SpamBayes package,
*and* the SpamBayes scripts can be imported.

        def fix_sys_path():
    # XXX - MarkH had the bright idea *after* writing this that we should
    # ensure the CVS version of SpamBayes is *not* used to resolve SB imports.
    # This would allow us to effectively test the distutils setup script, so
    # any modules or files missing from the installed version raise errors.
    """Fix sys.path so that the core SpamBayes package,
    *and* the SpamBayes scripts can be imported.
    """
    this_dir = os.path.dirname(__file__)
    try:
        import spambayes.Version
    except ImportError:
        # Apparently SpamBayes is yet to be "setup.py install"
        # We are in 'spambayes\spambayes\test' - 2 parents up should
        # do it.
        sb_dir = os.path.abspath(
                     os.path.join(this_dir, "..", ".."))
        sys.path.insert(0, sb_dir)
        import spambayes.Version

    # Now do the same for the sb_* scripts
    try:
        import sb_server
    except ImportError:
        # Scripts are usually in "spambayes/scripts" (for an
        # installed SpamBayes, they appear to be in
        # os.path.join(sys.prefix(), "scripts"), which we may like to
        # leverage - however, these test scripts are not currently
        # installed).
        script_dir = os.path.abspath(
                     os.path.join(this_dir, "..", "..", "scripts"))
        sys.path.insert(0, script_dir)
        import sb_server
        


src/s/p/spambayes-1.1b1/spambayes/test/test_storage.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes.storage import ZODBClassifier, CDBClassifier

src/s/p/spambayes-1.1b1/spambayes/test/test_stats.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes.Stats import Stats

src/s/p/spambayes-1.1b1/spambayes/test/test_smtpproxy.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes import asyncore

src/s/p/spambayes-1.1b1/spambayes/test/test_sb_server.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes import asyncore

src/s/p/spambayes-1.1b1/spambayes/test/test_sb_pop3dnd.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes import Dibbler

src/s/p/spambayes-1.1b1/spambayes/test/test_sb_imapfilter.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes import message

src/s/p/spambayes-1.1b1/spambayes/test/test_sb_filter.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes.Options import options

src/s/p/spambayes-1.1b1/spambayes/test/test_sb_dbexpimp.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
import sb_dbexpimp

src/s/p/spambayes-1.1b1/spambayes/test/test_programs.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
import sb_server

src/s/p/spambayes-1.1b1/spambayes/test/test_message.py   spambayes(Download)
 
import sb_test_support
sb_test_support.fix_sys_path()
 
from spambayes.Options import options

  1 | 2  Next