configuration.py 784 B

1234567891011121314151617181920212223242526272829
  1. from sympa.utils import getFileContent
  2. import json
  3. settings = {
  4. 'subscribersFile': './subscribers.json',
  5. 'listName': None,
  6. 'blacklistFile': './blacklist.txt',
  7. 'debug': False,
  8. 'logFile': './hackymod.log',
  9. 'listContactEmail': None,
  10. 'sympaCommandEmail': None,
  11. 'imapSSLServer': None,
  12. 'imapSSLPort': None,
  13. 'smtpServer': None,
  14. 'smtpPort': None,
  15. 'moderatorEmail': None,
  16. 'moderatorPassword': None,
  17. 'getSubscribersMinutesInterval': 1440, # Retrieve subscribers each 24hrs
  18. 'moderationMinutesInterval': 15 #
  19. }
  20. def loadConfiguration(filename):
  21. content = getFileContent(filename, parseJson=True)
  22. settingsKeys = settings.keys()
  23. for key in settingsKeys:
  24. if content.get(key):
  25. settings[key] = content[key]