/[gentoo-x86]/eclass/python.eclass
Gentoo

Diff of /eclass/python.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.3 2003/10/09 08:57:20 liquidx Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.4 2003/10/09 15:11:24 liquidx Exp $
4# 4#
5# Author: Alastair Tse <liquidx@gentoo.org> 5# Author: Alastair Tse <liquidx@gentoo.org>
6# 6#
7# A Utility Eclass that should be inherited by anything that deals with 7# A Utility Eclass that should be inherited by anything that deals with
8# Python or Python modules. 8# Python or Python modules.
23INHERITED="$INHERITED $ECLASS" 23INHERITED="$INHERITED $ECLASS"
24 24
25python_disable_pyc() { 25python_disable_pyc() {
26 export PYTHON_DONTCOMPILE=1 26 export PYTHON_DONTCOMPILE=1
27} 27}
28
29python_enable_pyc() {
30 unset PYTHON_DONTCOMPILE
31}
32
33python_disable_pyc
28 34
29# 35#
30# name: python_version 36# name: python_version
31# desc: run without arguments and it will export the version of python 37# desc: run without arguments and it will export the version of python
32# currently in use as $PYVER 38# currently in use as $PYVER
113# in the supplied directory 119# in the supplied directory
114# exam: 120# exam:
115# python_mod_optimize ${ROOT}usr/share/codegen 121# python_mod_optimize ${ROOT}usr/share/codegen
116# 122#
117python_mod_optimize() { 123python_mod_optimize() {
118 einfo "Byte Compiling Python modules .."
119 python_version 124 python_version
120 echo ${PYVER} 125 einfo "Byte Compiling Python modules for ${PYVER} .."
121 python ${ROOT}usr/lib/python${PYVER}/compileall.py $@ 126 python ${ROOT}usr/lib/python${PYVER}/compileall.py -q $@
127 python -O ${ROOT}usr/lib/python${PYVER}/compileall.py -q $@
122} 128}
123 129
124# 130#
125# name: python_mod_cleanup 131# name: python_mod_cleanup
126# desc: run with optional arguments, where arguments are directories of 132# desc: run with optional arguments, where arguments are directories of

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20