Commit 6009e5ac authored by Nicolas Wavrant's avatar Nicolas Wavrant

librecipe: better implementation of getValueFromPreviousRun using buildout API

The API call is made on a function existing both in buildout 1.7 and buildout 2.X
parent 2cbf8a1b
......@@ -26,7 +26,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import ConfigParser
import io
import logging
import os
......@@ -287,12 +286,7 @@ class GenericBaseRecipe(object):
Returns the value of a parameter from a previous run, if it exists.
Otherwise, returns None
"""
if os.path.exists(self.buildout['buildout']['installed']):
with open(self.buildout['buildout']['installed']) as config_file:
try:
parser = ConfigParser.RawConfigParser()
parser.readfp(config_file)
return parser.get(section, parameter)
except:
pass
return None
\ No newline at end of file
try:
return self.buildout._read_installed_part_options()[section].get(parameter, None)
except KeyError:
return None
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment