浏览代码

allow editing `mostrecent` audio

boyska 6 年之前
父节点
当前提交
6490c567ff
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      larigira/audioform_mostrecent.py

+ 8 - 0
larigira/audioform_mostrecent.py

@@ -26,6 +26,14 @@ class AudioForm(Form):
                                       "(in seconds) or a human-readable "
                                       "string like '1h2m'  or '1d12h'")
 
+    def populate_from_audiospec(self, audiospec):
+        if 'nick' in audiospec:
+            self.nick.data = audiospec['nick']
+        if 'path' in audiospec:
+            self.path.data = audiospec['path']
+        if 'maxage' in audiospec:
+            self.maxage.data = audiospec['maxage']
+
 
 def audio_receive(form):
     return {