Example #1
0
 def map_info(self):
     if not self.location.known:
         if (self.address.location.gathered and
                 self.address.location.known) or self.address.geolocate():
             self.location = self.address.location
     if self.location.gathered and self.location.known:
         if self.name.defined():
             the_info = self.name.full()
         else:
             the_info = capitalize(self.object_name())
         the_info += ' [NEWLINE] ' + self.location.description
         result = {
             'latitude': self.location.latitude,
             'longitude': self.location.longitude,
             'info': the_info
         }
         if hasattr(self, 'icon'):
             result['icon'] = self.icon
         elif self is this_thread.user:
             result['icon'] = {
                 'path': 'CIRCLE',
                 'scale': 5,
                 'strokeColor': 'blue'
             }
         return [result]
     return None
Example #2
0
 def pronoun_objective(self, **kwargs):
     """Returns "it" or "It" depending on the value of the optional
     keyword argument "capitalize." """
     output = word('it', **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #3
0
 def pronoun_objective(self, **kwargs):
     """Returns "it" or "It" depending on the value of the optional
     keyword argument "capitalize." """
     output = word('it', **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)            
Example #4
0
 def yourself_or_name(self, **kwargs):
     if self == this_thread.user:
         output = word('yourself')
     else:
         output = self.name.full()
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #5
0
 def is_are_you(self, **kwargs):
     if self is this_thread.user:
         output = 'are you'
     else:
         output = 'is ' + str(self.name)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #6
0
 def yourself_or_name(self, **kwargs):
     if self == this_thread.user:
         output = word("yourself")
     else:
         output = self.name.full()
     if "capitalize" in kwargs and kwargs["capitalize"]:
         return capitalize(output)
     else:
         return output
Example #7
0
 def yourself_or_name(self, **kwargs):
     if self == this_thread.user:
         output = word('yourself')
     else:
         output = self.name.full()
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #8
0
 def is_are_you(self, **kwargs):
     if self is this_thread.user:
         output = "are you"
     else:
         output = "is " + str(self.name)
     if "capitalize" in kwargs and kwargs["capitalize"]:
         return capitalize(output)
     else:
         return output
Example #9
0
 def is_are_you(self, **kwargs):
     if self is this_thread.user:
         output = 'are you'
     else:
         output = 'is ' + str(self.name)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #10
0
 def is_are_you(self, **kwargs):
     """Returns "are you" if the object is the user, otherwise returns
     "is" followed by the object name."""
     if self is this_thread.user:
         output = word('are you', **kwargs)
     else:
         output = is_word(self.full(), **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #11
0
 def pronoun_subjective(self, **kwargs):
     if self == this_thread.user and ('thirdperson' not in kwargs or not kwargs['thirdperson']):
         output = word('you')
     elif self.gender == 'female':
         output = word('she')
     else:
         output = word('he')
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #12
0
 def pronoun(self, **kwargs):
     if self == this_thread.user:
         output = word('you')
     if self.gender == 'female':
         output = word('her')
     else:
         output = word('him')
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #13
0
 def pronoun_possessive(self, target, **kwargs):
     if self == this_thread.user and ('thirdperson' not in kwargs or not kwargs['thirdperson']):
         output = your(target)
     elif self.gender == 'female':
         output = her(target)
     else:
         output = his(target)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)            
Example #14
0
 def pronoun_subjective(self, **kwargs):
     if self == this_thread.user and ("thirdperson" not in kwargs or not kwargs["thirdperson"]):
         output = word("you")
     elif self.gender == "female":
         output = word("she")
     else:
         output = word("he")
     if "capitalize" in kwargs and kwargs["capitalize"]:
         return capitalize(output)
     else:
         return output
Example #15
0
 def pronoun(self, **kwargs):
     if self == this_thread.user:
         output = word("you")
     if self.gender == "female":
         output = word("her")
     else:
         output = word("him")
     if "capitalize" in kwargs and kwargs["capitalize"]:
         return capitalize(output)
     else:
         return output
Example #16
0
 def pronoun_possessive(self, target, **kwargs):
     if self == this_thread.user and ("thirdperson" not in kwargs or not kwargs["thirdperson"]):
         output = your(target)
     elif self.gender == "female":
         output = her(target)
     else:
         output = his(target)
     if "capitalize" in kwargs and kwargs["capitalize"]:
         return capitalize(output)
     else:
         return output
Example #17
0
 def pronoun(self, **kwargs):
     if self == this_thread.user:
         output = word('you')
     if self.gender == 'female':
         output = word('her')
     else:
         output = word('him')
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #18
0
 def is_are_you(self, **kwargs):
     """Returns "are you" if the object is the user, otherwise returns
     "is" followed by the object name."""
     if self is this_thread.user:
         output = word('are you', **kwargs)
     else:
         output = is_word(self.full(), **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #19
0
 def yourself_or_name(self, **kwargs):
     """Returns a "yourself" if the individual is the user, otherwise 
     returns the individual's name."""
     if self == this_thread.user:
         output = word('yourself', **kwargs)
     else:
         output = self.name.full()
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #20
0
 def yourself_or_name(self, **kwargs):
     """Returns a "yourself" if the individual is the user, otherwise 
     returns the individual's name."""
     if self == this_thread.user:
         output = word('yourself', **kwargs)
     else:
         output = self.name.full()
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #21
0
 def pronoun(self, **kwargs):
     """Returns a pronoun like "you," "her," or "him," as appropriate."""
     if self == this_thread.user:
         output = word('you', **kwargs)
     if self.gender == 'female':
         output = word('her', **kwargs)
     else:
         output = word('him', **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #22
0
 def pronoun_possessive(self, target, **kwargs):
     """Given a word like "fish," returns "her fish" or "his fish," as appropriate."""
     if self == this_thread.user and ('thirdperson' not in kwargs or not kwargs['thirdperson']):
         output = your(target, **kwargs)
     elif self.gender == 'female':
         output = her(target, **kwargs)
     else:
         output = his(target, **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)            
Example #23
0
 def pronoun_subjective(self, **kwargs):
     """Returns a pronoun like "you," "she," or "he," as appropriate."""
     if self == this_thread.user and ('thirdperson' not in kwargs or not kwargs['thirdperson']):
         output = word('you', **kwargs)
     elif self.gender == 'female':
         output = word('she', **kwargs)
     else:
         output = word('he', **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return(capitalize(output))
     else:
         return(output)
Example #24
0
 def pronoun_subjective(self, **kwargs):
     if self == this_thread.user and ('thirdperson' not in kwargs
                                      or not kwargs['thirdperson']):
         output = word('you')
     elif self.gender == 'female':
         output = word('she')
     else:
         output = word('he')
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #25
0
 def pronoun(self, **kwargs):
     """Returns a pronoun like "you," "her," or "him," as appropriate."""
     if self == this_thread.user:
         output = word('you', **kwargs)
     if self.gender == 'female':
         output = word('her', **kwargs)
     else:
         output = word('him', **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #26
0
 def pronoun_possessive(self, target, **kwargs):
     if self == this_thread.user and ('thirdperson' not in kwargs
                                      or not kwargs['thirdperson']):
         output = your(target)
     elif self.gender == 'female':
         output = her(target)
     else:
         output = his(target)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #27
0
 def pronoun_possessive(self, target, **kwargs):
     """Given a word like "fish," returns "her fish" or "his fish," as appropriate."""
     if self == this_thread.user and ('thirdperson' not in kwargs
                                      or not kwargs['thirdperson']):
         output = your(target, **kwargs)
     elif self.gender == 'female':
         output = her(target, **kwargs)
     else:
         output = his(target, **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #28
0
 def pronoun_subjective(self, **kwargs):
     """Returns a pronoun like "you," "she," or "he," as appropriate."""
     if self == this_thread.user and ('thirdperson' not in kwargs
                                      or not kwargs['thirdperson']):
         output = word('you', **kwargs)
     elif self.gender == 'female':
         output = word('she', **kwargs)
     else:
         output = word('he', **kwargs)
     if 'capitalize' in kwargs and kwargs['capitalize']:
         return (capitalize(output))
     else:
         return (output)
Example #29
0
 def map_info(self):
     response = list()
     for office in self.office:
         if (office.location.gathered and office.location.known) or office.geolocate():
             if self.name.defined():
                 the_info = self.name.full()
             else:
                 the_info = capitalize(self.object_name())
             the_info += ' [NEWLINE] ' + office.location.description
             this_response = {'latitude': office.location.latitude, 'longitude': office.location.longitude, 'info': the_info}
             if hasattr(self, 'icon'):
                 this_response['icon'] = self.icon
             response.append(this_response)
     if len(response):
         return response
     return None
Example #30
0
 def _map_info(self):
     if not self.location.known:
         if (self.address.location.gathered and self.address.location.known) or self.address.geolocate():
             self.location = self.address.location
     if self.location.gathered and self.location.known:
         if self.name.defined():
             the_info = self.name.full()
         else:
             the_info = capitalize(self.object_name())
         the_info += ' [NEWLINE] ' + self.location.description
         result = {'latitude': self.location.latitude, 'longitude': self.location.longitude, 'info': the_info}
         if hasattr(self, 'icon'):
             result['icon'] = self.icon
         elif self is this_thread.user:
             result['icon'] = {'path': 'CIRCLE', 'scale': 5, 'strokeColor': 'blue'}
         return [result]
     return None
Example #31
0
 def map_info(self):
     if not self.location.known:
         if (self.address.location.gathered and self.address.location.known) or self.address.geolocate():
             self.location = self.address.location
     if self.location.gathered and self.location.known:
         if self.name.defined():
             the_info = self.name.full()
         else:
             the_info = capitalize(self.object_name())
         the_info += " [NEWLINE] " + self.location.description
         result = {"latitude": self.location.latitude, "longitude": self.location.longitude, "info": the_info}
         if hasattr(self, "icon"):
             result["icon"] = self.icon
         elif self is this_thread.user:
             result["icon"] = {"path": "CIRCLE", "scale": 5, "strokeColor": "blue"}
         return [result]
     return None
Example #32
0
 def map_info(self):
     response = list()
     for office in self.office:
         if (office.location.gathered and office.location.known) or office.geolocate():
             if self.name.defined():
                 the_info = self.name.full()
             else:
                 the_info = capitalize(self.object_name())
             the_info += " [NEWLINE] " + office.location.description
             this_response = {
                 "latitude": office.location.latitude,
                 "longitude": office.location.longitude,
                 "info": the_info,
             }
             if hasattr(self, "icon"):
                 this_response["icon"] = self.icon
             response.append(this_response)
     if len(response):
         return response
     return None
Example #33
0
 def map_info(self):
     response = list()
     for office in self.office:
         if (office.location.gathered
                 and office.location.known) or office.geolocate():
             if self.name.defined():
                 the_info = self.name.full()
             else:
                 the_info = capitalize(self.object_name())
             the_info += ' [NEWLINE] ' + office.location.description
             this_response = {
                 'latitude': office.location.latitude,
                 'longitude': office.location.longitude,
                 'info': the_info
             }
             if hasattr(self, 'icon'):
                 this_response['icon'] = self.icon
             response.append(this_response)
     if len(response):
         return response
     return None