[PATCH] Use the AnacondaWidgets python gi-overrides for pylint

Vratislav Podzimek vpodzime at redhat.com
Thu Apr 3 06:01:06 UTC 2014


On Wed, 2014-04-02 at 13:16 -0400, David Shea wrote:
> ---
>  tests/pylint/pylint-one.sh | 3 +++
>  tests/testenv.sh           | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/tests/pylint/pylint-one.sh b/tests/pylint/pylint-one.sh
> index 9759293..abb3824 100755
> --- a/tests/pylint/pylint-one.sh
> +++ b/tests/pylint/pylint-one.sh
> @@ -17,6 +17,9 @@ pylint_output="$(pylint \
>      --ignored-classes=DefaultInstall,Popen,QueueFactory,TransactionSet \
>      --defining-attr-methods=__init__,_grabObjects,initialize,reset,start,setUp \
>      --load-plugins=intl,preconf,markup \
> +    --init-hook=\
> +'import gi.overrides, os;
> +gi.overrides.__path__[0:0] = (os.environ["ANACONDA_WIDGETS_OVERRIDES"].split(":") if "ANACONDA_WIDGETS_OVERRIDES" in os.environ else [])' \
>      $DISABLED_WARN_OPTIONS \
>      $DISABLED_ERR_OPTIONS \
>      $NON_STRICT_OPTIONS "$@" 2>&1 | \
> diff --git a/tests/testenv.sh b/tests/testenv.sh
> index 9493451..017559d 100644
> --- a/tests/testenv.sh
> +++ b/tests/testenv.sh
> @@ -29,3 +29,7 @@ export LD_LIBRARY_PATH
>  export PYTHONPATH
>  export top_srcdir
>  export top_builddir
> +
> +# This must be added to gi.overrides.__path__ by any test requiring the
> +# AnacondaWidgets gi-overrides
> +export ANACONDA_WIDGETS_OVERRIDES="${top_srcdir}/widgets/python"
ACK. Didn't now about the [0:0] shortcut for insert. Quite nice.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list