Skip to content

Commit b4018cf

Browse files
Chris HooksChris Hooks
authored andcommitted
Fixed documentation and removed 'object_type.deleter' in Agent
1 parent 3f5cad0 commit b4018cf

File tree

4 files changed

+101
-9
lines changed

4 files changed

+101
-9
lines changed

tincan/agent.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ def object_type(self):
4545
def object_type(self, value):
4646
self._object_type = 'Agent'
4747

48-
@object_type.deleter
49-
def object_type(self):
50-
del self._object_type
51-
5248
@property
5349
def name(self):
5450
"""Name for Agent

tincan/agent_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from tincan.typed_list import TypedList
1717

1818
"""
19-
.. module:: interactioncomponentlist
19+
.. module:: agent_list
2020
:synopsis: A wrapper for list that is able to type check
2121
2222
"""

tincan/context.py

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ class Context(SerializableBase):
4949

5050
@property
5151
def registration(self):
52+
"""Registration for Context
53+
54+
:setter: Tries to convert to unicode
55+
:setter type: unicode
56+
:rtype: unicode
57+
58+
"""
5259
return self._registration
5360

5461
@registration.setter
@@ -65,6 +72,13 @@ def registration(self):
6572

6673
@property
6774
def instructor(self):
75+
"""Instructor for Context
76+
77+
:setter: Tries to convert to Agent or Group
78+
:setter type: :mod:`tincan.agent` | :mod:`tincan.group`
79+
:rtype: :mod:`tincan.agent` | :mod:`tincan.group`
80+
81+
"""
6882
return self._instructor
6983

7084
@instructor.setter
@@ -82,6 +96,13 @@ def instructor(self):
8296

8397
@property
8498
def team(self):
99+
"""Team for Context
100+
101+
:setter: Tries to convert to Group
102+
:setter type: :mod:`tincan.group`
103+
:rtype: :mod:`tincan.group`
104+
105+
"""
85106
return self._team
86107

87108
@team.setter
@@ -96,6 +117,13 @@ def team(self):
96117

97118
@property
98119
def context_activities(self):
120+
"""Context Activities for Context
121+
122+
:setter: Tries to convert to Context Activities
123+
:setter type: :mod:`tincan.context_activities`
124+
:rtype: :mod:`tincan.context_activities`
125+
126+
"""
99127
return self._context_activities
100128

101129
@context_activities.setter
@@ -105,17 +133,24 @@ def context_activities(self, value):
105133
self._context_activities = value
106134

107135
@context_activities.deleter
108-
def context_activities(self, value):
136+
def context_activities(self):
109137
del self._context_activities
110138

111139
@property
112140
def revision(self):
141+
"""Revision for Context
142+
143+
:setter: Tries to convert to unicode
144+
:setter type: unicode
145+
:rtype: unicode
146+
147+
"""
113148
return self._revision
114149

115150
@revision.setter
116151
def revision(self, value):
117152
if value is not None and not isinstance(value, basestring):
118-
value = str(value)
153+
value = unicode(value)
119154
self._revision = value
120155

121156
@revision.deleter
@@ -124,12 +159,19 @@ def revision(self):
124159

125160
@property
126161
def platform(self):
162+
"""Platform for Context
163+
164+
:setter: Tries to convert to unicode
165+
:setter type: unicode
166+
:rtype: unicode
167+
168+
"""
127169
return self._platform
128170

129171
@platform.setter
130172
def platform(self, value):
131173
if value is not None and not isinstance(value, basestring):
132-
value = str(value)
174+
value = unicode(value)
133175
self._platform = value
134176

135177
@platform.deleter
@@ -138,13 +180,20 @@ def platform(self):
138180

139181
@property
140182
def language(self):
183+
"""Language for Context
184+
185+
:setter: Tries to convert to unicode
186+
:setter type: unicode
187+
:rtype: unicode
188+
189+
"""
141190
return self._language
142191

143192
@language.setter
144193
def language(self, value):
145194
if value is not None:
146195
if not isinstance(value, basestring):
147-
value = str(value)
196+
value = unicode(value)
148197
if not self._LANG_REGEX.match(value):
149198
raise ValueError("invalid regional identifier")
150199
self._language = value
@@ -155,6 +204,13 @@ def language(self):
155204

156205
@property
157206
def statement(self):
207+
"""Statement for Context
208+
209+
:setter: Tries to convert to StatementRef
210+
:setter type: :mod:`tincan.statement_ref`
211+
:rtype: :mod:`tincan.statement_ref`
212+
213+
"""
158214
return self._statement
159215

160216
@statement.setter
@@ -169,6 +225,13 @@ def statement(self):
169225

170226
@property
171227
def extensions(self):
228+
"""Extensions for Context
229+
230+
:setter: Tries to convert to StatementRef
231+
:setter type: :mod:`tincan.extensions`
232+
:rtype: :mod:`tincan.extensions`
233+
234+
"""
172235
return self._extensions
173236

174237
@extensions.setter

tincan/context_activities.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ class ContextActivities(SerializableBase):
2929

3030
@property
3131
def category(self):
32+
"""Category for Context Activities
33+
34+
:setter: Tries to convert to Activity List
35+
:setter type: :mod:`tincan.activity_list`
36+
:rtype: :mod:`tincan.activity_list`
37+
38+
"""
3239
return self._category
3340

3441
@category.setter
@@ -42,6 +49,13 @@ def category(self):
4249

4350
@property
4451
def parent(self):
52+
"""Parent for Context Activities
53+
54+
:setter: Tries to convert to Activity List
55+
:setter type: :mod:`tincan.activity_list`
56+
:rtype: :mod:`tincan.activity_list`
57+
58+
"""
4559
return self._parent
4660

4761
@parent.setter
@@ -55,6 +69,13 @@ def parent(self):
5569

5670
@property
5771
def grouping(self):
72+
"""Grouping for Context Activities
73+
74+
:setter: Tries to convert to Activity List
75+
:setter type: :mod:`tincan.activity_list`
76+
:rtype: :mod:`tincan.activity_list`
77+
78+
"""
5879
return self._grouping
5980

6081
@grouping.setter
@@ -68,6 +89,13 @@ def grouping(self):
6889

6990
@property
7091
def other(self):
92+
"""Other for Context Activities
93+
94+
:setter: Tries to convert to Activity List
95+
:setter type: :mod:`tincan.activity_list`
96+
:rtype: :mod:`tincan.activity_list`
97+
98+
"""
7199
return self._other
72100

73101
@other.setter
@@ -80,6 +108,11 @@ def other(self):
80108
del self._other
81109

82110
def _activity_or_list(self, value):
111+
"""Tries to convert value to an Activity List
112+
113+
:param value: The value to attempt to convert to Activity List
114+
:return: A :mod:`tincan.activity_list` of value
115+
"""
83116
result = value
84117
if value is not None and not isinstance(value, ActivityList):
85118
try:

0 commit comments

Comments
 (0)