Commit 5fc9f5c3 authored by Łukasz Nowak's avatar Łukasz Nowak

Avoid unnecessary class attributes.

rebootstrap_section, relative_python and prefix are only used in __init__
method and there is no need to clutter object.
parent 7a73f938
...@@ -26,14 +26,14 @@ class Rebootstrap: ...@@ -26,14 +26,14 @@ class Rebootstrap:
self.logger = logging.getLogger(__name__) self.logger = logging.getLogger(__name__)
self.buildout = buildout self.buildout = buildout
# fetch section of rebootstrap, obligatory # fetch section of rebootstrap, obligatory
self.rebootstrap_section = buildout['rebootstrap'] rebootstrap_section = buildout['rebootstrap']
# leave garbage? only in case of developer mode # leave garbage? only in case of developer mode
self.developer_mode = self.rebootstrap_section.get('developer-mode', self.developer_mode = rebootstrap_section.get('developer-mode',
'false') == 'true' 'false') == 'true'
# fetch section to build python, obligatory # fetch section to build python, obligatory
self.python_section = self.rebootstrap_section['section'].strip() self.python_section = rebootstrap_section['section'].strip()
# fetch version of python build, obligatory # fetch version of python build, obligatory
self.version = self.rebootstrap_section['version'].strip() version = rebootstrap_section['version'].strip()
# usualy python will be try to found by convention in: # usualy python will be try to found by convention in:
# prefixed-parts/part-name/bin/part-name # prefixed-parts/part-name/bin/part-name
...@@ -41,21 +41,21 @@ class Rebootstrap: ...@@ -41,21 +41,21 @@ class Rebootstrap:
# find it as # find it as
# prefixed-parts/part-name/python-path # prefixed-parts/part-name/python-path
# where python-path is relative path to python interpreter # where python-path is relative path to python interpreter
self.relative_python = self.rebootstrap_section.get('python-path', '' relative_python = rebootstrap_section.get('python-path', ''
).strip() or os.path.join('bin', self.python_section) ).strip() or os.path.join('bin', self.python_section)
# query for currently running python # query for currently running python
self.running_python = sys.executable self.running_python = sys.executable
# generate rebootstrap.realname.version # generate rebootstrap.realname.version
self.prefix = 'rebootstrap.' + self.version + '.' prefix = 'rebootstrap.' + version + '.'
self.installed = '.' + self.prefix + 'installed.cfg' self.installed = '.' + prefix + 'installed.cfg'
self.parts_directory = os.path.join(self.buildout['buildout'][ self.parts_directory = os.path.join(self.buildout['buildout'][
'directory'], self.prefix + 'parts') 'directory'], prefix + 'parts')
# query for wanted python, which is combination of suffixed parts # query for wanted python, which is combination of suffixed parts
# and working recipe # and working recipe
self.wanted_python = os.path.join(self.parts_directory, self.wanted_python = os.path.join(self.parts_directory,
self.python_section, self.relative_python) self.python_section, relative_python)
def __call__(self): def __call__(self):
self.install_section() self.install_section()
......
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