質問編集履歴
1
インデント等を修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,53 +6,53 @@
|
|
6
6
|
|
7
7
|
class Guide():
|
8
8
|
|
9
|
-
def construct(self,
|
9
|
+
def construct(self, builder):
|
10
10
|
|
11
|
-
rerources_list = builder.get_resources_list()
|
11
|
+
rerources_list = builder.get_resources_list()
|
12
12
|
|
13
|
-
for resource in resources_list:
|
13
|
+
for resource in resources_list:
|
14
14
|
|
15
|
-
return builder.get_user_name(resource)
|
15
|
+
return builder.get_user_name(resource)
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
class Resource(metaclass=abc.ABCMeta)
|
19
|
+
class Resource(metaclass=abc.ABCMeta):
|
20
20
|
|
21
|
-
@abc.abstractmethod
|
21
|
+
@abc.abstractmethod
|
22
22
|
|
23
|
-
def get_resources_list(self):
|
23
|
+
def get_resources_list(self):
|
24
24
|
|
25
|
-
pass
|
25
|
+
pass
|
26
26
|
|
27
|
-
@abc.abstractmethod
|
27
|
+
@abc.abstractmethod
|
28
28
|
|
29
|
-
def get_user_name(self):
|
29
|
+
def get_user_name(self):
|
30
30
|
|
31
|
-
pass
|
31
|
+
pass
|
32
32
|
|
33
33
|
|
34
34
|
|
35
35
|
class Sg(Resource):
|
36
36
|
|
37
|
-
def get_resources_list(self):
|
37
|
+
def get_resources_list(self):
|
38
38
|
|
39
|
-
resources_list = ['aaa', 'bbb', 'ccc']
|
39
|
+
resources_list = ['aaa', 'bbb', 'ccc']
|
40
40
|
|
41
|
-
return resources_list
|
41
|
+
return resources_list
|
42
42
|
|
43
43
|
|
44
44
|
|
45
45
|
def get_user_name(self, resource):
|
46
46
|
|
47
|
-
return resource, 'xxx'
|
47
|
+
return resource, 'xxx'
|
48
48
|
|
49
49
|
|
50
50
|
|
51
|
-
if_
|
51
|
+
if__name__=='__main__':
|
52
52
|
|
53
|
-
ans = Guide().construct(Sg())() #ここでエラー
|
53
|
+
ans = Guide().construct(Sg())() #ここでエラー
|
54
54
|
|
55
|
-
print(ans)
|
55
|
+
print(ans)
|
56
56
|
|
57
57
|
|
58
58
|
|