/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/win32/run_script.py

  • Committer: John Arbash Meinel
  • Date: 2008-12-09 21:35:49 UTC
  • mto: This revision was merged to the branch mainline in revision 3888.
  • Revision ID: john@arbash-meinel.com-20081209213549-yc1mqv3l5gun9c63
Start working on a FIFOCache.

This is designed to have less runtime cost than the LRUCache.
Mostly because we don't have to do any recording work on *access*
only on update or delete.
As such, we subclass dict directly, because experiments show that
it performed the best. Unfortunately, even though we don't have
a custom __getitem__ implementation, it is still approx 2x slower
than using a raw dict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# A utility that executes a script from our %PYTHON%\Scripts directory.
 
2
# Example usage:
 
3
# 'python run_script.py cog.py arg1 arg2'
 
4
# which will locate %PYTHON_HOME%/Scripts/cog.py and execute it with the args.
 
5
# This is only necessary for Windows, and only when the build process is
 
6
# executed via a cygwin/*nix based make utility, which doesn't honor the
 
7
# PATHEXT environment variable.
 
8
import sys
 
9
import os
 
10
 
 
11
if __name__ == '__main__':
 
12
    # clobber me, new sys.argv[0] is the script to run.
 
13
    del sys.argv[0]
 
14
    assert not os.path.isabs(sys.argv[0]), "If you know the FQ path, just use it!"
 
15
    sys.argv[0] = os.path.join(sys.prefix, "Scripts", sys.argv[0])
 
16
    execfile(sys.argv[0])