summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-02-13 10:39:42 +0900
committerKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-04-09 14:59:34 +0900
commit5b3ba7911d0d2c64da59c5020f9307c1222edc58 (patch)
tree1d9c3f9e4ff2482b6c63eecde25d4b9025dd758c
parentd8acb2a5980b7e60087baba75344a7df37253122 (diff)
view: add get_data()
To support relationships, directly getting Yaml data on each function is more useful. Let's add get_data() and do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-rwxr-xr-xscripts/view.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/scripts/view.py b/scripts/view.py
index b73095c..04928e1 100755
--- a/scripts/view.py
+++ b/scripts/view.py
@@ -49,10 +49,21 @@ class viewer(base.base):
self.parse(arg)
#--------------------
+ # get_data
+ #--------------------
+ def get_data(self, file):
+ F = open(file, "r+")
+ data = yaml.load(F)
+ F.close()
+ return data
+
+ #--------------------
# make_one
# for --oneline
#--------------------
- def make_one(self, file, data):
+ def make_one(self, file):
+
+ data = self.get_data(file)
if (len(self.text) > 0):
self.text += "\n"
@@ -66,7 +77,9 @@ class viewer(base.base):
# make_full
# for normal
#--------------------
- def make_full(self, file, data):
+ def make_full(self, file):
+
+ data = self.get_data(file)
if (len(self.text) > 0):
self.text += "\n"
@@ -98,14 +111,10 @@ class viewer(base.base):
#--------------------
def show(self):
for f in self.files:
- F = open(f, "r+")
- data = yaml.load(F)
- F.close()
-
if (self.one_line):
- self.make_one(f, data)
+ self.make_one(f)
else:
- self.make_full(f, data)
+ self.make_full(f)
# escape " -> \"
# otherwise " will be disappeared