소스 검색

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 {