From 71ec5a1d04094da7bce5f542978ed49bd302e178 Mon Sep 17 00:00:00 2001 From: "Niall Douglas (a [underscors] sourceforge {at} nedprod [dot] com)" Date: Wed, 22 Feb 2012 17:46:06 +0000 Subject: Cherrypick improved zipfile support from Niall Douglas. WTK: This is the meat of Niall's commit 4632cb6d22faa7220540f92af67693084f80f033 Author: Niall Douglas ... Date: Wed Feb 22 17:46:06 2012 +0000 Fixed small bug where running from inside zip support was over preferring .pyc files --- libbe/util/plugin.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'libbe/util/plugin.py') diff --git a/libbe/util/plugin.py b/libbe/util/plugin.py index 1fee690..63715a0 100644 --- a/libbe/util/plugin.py +++ b/libbe/util/plugin.py @@ -72,17 +72,23 @@ def modnames(prefix): components = prefix.split('.') modfilespath=os.path.join(_PLUGIN_PATH, *components) # Cope if we are executing from inside a zip archive full of precompiled .pyc's - modfiles=ziplistdir(modfilespath) if '.zip' in modfilespath else os.listdir(modfilespath) + inside_zip='.zip' in modfilespath + modfiles=ziplistdir(modfilespath) if inside_zip else os.listdir(modfilespath) modfiles.sort() - # Eliminate .py/.pyc duplicates - print modfiles - x=1 - while x