Skip to content

1.3.2

Latest
Compare
Choose a tag to compare
@dotchetter dotchetter released this 26 Dec 19:05

V 1.3.2

🌟 News

  • Removed clutter from log entries

    The log entries from Pyttman are now cleaner, without as much clutter for each log entry.

  • New argment to EntityField classes available: post_processor

    The post_processor argument allows you to define a function which will be called on the value of the entity after it has been parsed. This is useful for scenarios where you want to clean up the value of the entity, or perform other operations on it before it is stored in message.entities in the respond method.

    class SomeIntent(Intent):
        """
        In this example, the name will be stripped of any leading or trailing whitespace.
        """
        name = StringEntityField(default="", post_processor=lambda x: x.strip())  
  • All ability classes are now available by exact name on the app instance

    The app instance in Pyttman apps now has all Ability classes available by their exact name, as defined in the settings.py file. This is useful for scenarios where you want to access the storage object of an ability, or other properties of the ability.

       # ability.py
       class SomeAbility(Ability):
           pass
      
       # settings.py
       ABILITIES = [
           "some_ability.SomeAbility"
       ]
    
       # any file in the project
       from pyttman import app
         

🐛 Splatted bugs and corrected issues

  • Fixed a bug where LOG_TO_STDOUT didn't work, and logs were not written to STDOUT: #86