소스 검색

add server class docstring, re-order vet_settings

Daniel Gruno 5 년 전
부모
커밋
640150b356
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      pypubsub.py

+ 2 - 1
pypubsub.py

@@ -37,6 +37,7 @@ PUBSUB_BAD_PAYLOAD = "Bad payload type. Payloads must be JSON dictionary objects
 
 
 class Server:
+    """Main server class, responsible for handling requests and publishing events """
     def __init__(self):
         self.config = yaml.safe_load(open('pypubsub.yaml'))
         self.lconfig = None
@@ -46,8 +47,8 @@ class Server:
         self.last_ping = time.time()
 
         if 'ldap' in self.config.get('clients', {}):
-            pypubsub_ldap.vet_settings(self.config['clients']['ldap'])
             self.lconfig = self.config['clients']['ldap']
+            pypubsub_ldap.vet_settings(self.lconfig)
         self.acl = {}
         try:
             self.acl = yaml.safe_load(open('pypubsub_acl.yaml'))