mirror of
https://github.com/drasko/codezero.git
synced 2026-04-04 19:19:03 +02:00
Moved all class-level attributes to instance variables.
This commit is contained in:
@@ -4,20 +4,24 @@ import os, sys, shelve, shutil, re
|
|||||||
from projpaths import *
|
from projpaths import *
|
||||||
|
|
||||||
class Container:
|
class Container:
|
||||||
name = None
|
def __init__(self):
|
||||||
type = None
|
self.name = None
|
||||||
id = None
|
self.type = None
|
||||||
lma_start = None
|
self.id = None
|
||||||
lma_end = None
|
self.lma_start = None
|
||||||
vma_start = None
|
self.lma_end = None
|
||||||
vma_end = None
|
self.vma_start = None
|
||||||
|
self.vma_end = None
|
||||||
|
|
||||||
class configuration:
|
class configuration:
|
||||||
arch = None
|
|
||||||
subarch = None
|
def __init__(self):
|
||||||
platform = None
|
self.containers = []
|
||||||
all = []
|
self.arch = None
|
||||||
containers = []
|
self.subarch = None
|
||||||
|
self.platform = None
|
||||||
|
self.all = []
|
||||||
|
|
||||||
# Get all name value symbols
|
# Get all name value symbols
|
||||||
def get_all(self, name, val):
|
def get_all(self, name, val):
|
||||||
self.all.append([name, val])
|
self.all.append([name, val])
|
||||||
@@ -112,8 +116,8 @@ def configuration_save(config):
|
|||||||
config_shelve["configuration"] = config
|
config_shelve["configuration"] = config
|
||||||
|
|
||||||
# Save containers explicitly
|
# Save containers explicitly
|
||||||
for i, c in zip(range(len(config.containers)), config.containers):
|
# for i, c in zip(range(len(config.containers)), config.containers):
|
||||||
config_shelve["container" + str(i)] = c
|
# config_shelve["container" + str(i)] = c
|
||||||
|
|
||||||
# config_shelve["arch"] = configuration.arch
|
# config_shelve["arch"] = configuration.arch
|
||||||
# config_shelve["subarch"] = configuration.subarch
|
# config_shelve["subarch"] = configuration.subarch
|
||||||
@@ -128,9 +132,10 @@ def configuration_retrieve():
|
|||||||
config = config_shelve["configuration"]
|
config = config_shelve["configuration"]
|
||||||
|
|
||||||
# Retrieve and append containers explicitly
|
# Retrieve and append containers explicitly
|
||||||
for i in range(int(config.ncontainers)):
|
# for i in range(int(config.ncontainers)):
|
||||||
config.containers.append(config_shelve["container" + str(i)])
|
# config.containers.append(config_shelve["container" + str(i)])
|
||||||
|
|
||||||
config.containers.sort()
|
#config.containers.sort()
|
||||||
|
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|||||||
Reference in New Issue
Block a user