libbe.storage.util.upgrade

Handle conversion between the various BE storage formats.

class libbe.storage.util.upgrade.Upgrade_1_0_to_1_1(repo)

Methods

check_initial_version()
get_path(*args) Return the absolute path using args relative to .be.
set_version()
upgrade()
final_version = 'Bugs Everywhere Directory v1.1'
initial_version = 'Bugs Everywhere Tree 1 0'
class libbe.storage.util.upgrade.Upgrade_1_1_to_1_2(repo)

Methods

check_initial_version()
get_path(*args) Return the absolute path using args relative to .be.
set_version()
upgrade()
final_version = 'Bugs Everywhere Directory v1.2'
initial_version = 'Bugs Everywhere Directory v1.1'
class libbe.storage.util.upgrade.Upgrade_1_2_to_1_3(*args, **kwargs)

Methods

check_initial_version()
get_path(*args) Return the absolute path using args relative to .be.
set_version()
upgrade()
final_version = 'Bugs Everywhere Directory v1.3'
initial_version = 'Bugs Everywhere Directory v1.2'
class libbe.storage.util.upgrade.Upgrade_1_3_to_1_4(repo)

Methods

check_initial_version()
get_path(*args) Return the absolute path using args relative to .be.
set_version()
upgrade()
final_version = 'Bugs Everywhere Directory v1.4'
initial_version = 'Bugs Everywhere Directory v1.3'
class libbe.storage.util.upgrade.Upgrade_1_4_to_1_5(repo)

Methods

check_initial_version()
get_path(*args) Return the absolute path using args relative to .be.
set_version()
upgrade()
final_version = 'Bugs Everywhere Directory v1.5'
initial_version = 'Bugs Everywhere Directory v1.4'
class libbe.storage.util.upgrade.Upgrader(repo)

Class for converting between different on-disk BE storage formats.

Attributes

final_version
initial_version

Methods

check_initial_version()
get_path(*args) Return the absolute path using args relative to .be.
set_version()
upgrade()
check_initial_version()
final_version = None
get_path(*args)

Return the absolute path using args relative to .be.

initial_version = None
set_version()
upgrade()
libbe.storage.util.upgrade.generate_yaml_mapfile(map)

From v1.1 to v1.5, BE dirs used YAML mapfiles

>>> generate_yaml_mapfile({'q':'p'})
'q: p\n\n'
>>> generate_yaml_mapfile({'q':u'Fran\u00e7ais'})
'q: Fran\xc3\xa7ais\n\n'
>>> generate_yaml_mapfile({'q':u'hello'})
'q: hello\n\n'
libbe.storage.util.upgrade.parse_yaml_mapfile(contents)

From v1.1 to v1.5, BE dirs used YAML mapfiles

>>> parse_yaml_mapfile('q: p\n\n')['q']
'p'
>>> parse_yaml_mapfile('q: \'p\'\n\n')['q']
'p'
>>> contents = generate_yaml_mapfile({'a':'b', 'c':'d', 'e':'f'})
>>> dict = parse_yaml_mapfile(contents)
>>> dict['a']
'b'
>>> dict['c']
'd'
>>> dict['e']
'f'
>>> contents = generate_yaml_mapfile({'q':u'Fran\u00e7ais'})
>>> dict = parse_yaml_mapfile(contents)
>>> dict['q']
u'Fran\xe7ais'
libbe.storage.util.upgrade.upgrade(path, current_version, target_version='Bugs Everywhere Directory v1.5')

Call the appropriate upgrade function to convert current_version to target_version. If a direct conversion function does not exist, use consecutive conversion functions.

libbe.storage.util.upgrade.upgrader

alias of Upgrade_1_4_to_1_5

This Page