__init__.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. '''
  2. Botadero, una aplicacion para compartir archivos libremente.
  3. Copyright (C) 2016 Rodrigo Garcia <strysg@riseup.net>
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. '''
  15. # cargar configuraciones del servidor
  16. from flask import Flask
  17. app = Flask(__name__, static_url_path='/static')
  18. import botadero.views
  19. import botadero.utils
  20. app.config['UPLOAD_FOLDER'] = utils.ParametrosServer.UploadFolder
  21. # blueprints
  22. from botadero.archivos.views import mod as modulo_archivos
  23. app.register_blueprint(modulo_archivos)
  24. # ############## principal ########################
  25. if __name__ == '__main__':
  26. print "running from main"
  27. print
  28. print "------"
  29. app.run(host='0.0.0.0')
  30. # cargar configuraciones del servidor
  31. utils.EstadisticaArchivos.Inicializar()
  32. print "[PARAMETERS] - TOTAL_STORAGE=%d" %ParametrosServer.TotalStorage
  33. print "[PARAMETERS] - UPLOAD_FOLDER=%s" %ParametrosServer.UploadFolder
  34. print "[PARAMETERS] - SIZE_1=%d" %ParametrosServer.Size1
  35. print "[PARAMETERS] - SIZE_2=%d" %ParametrosServer.Size2
  36. print "[PARAMETERS] - TIME_TO_DEL_0=%d" %ParametrosServer.TimeToDel0
  37. print "[PARAMETERS] - TIME_TO_DEL_1=%d" %ParametrosServer.TimeToDel1
  38. print "[PARAMETERS] - TIME_TO_DEL_2=%d" %ParametrosServer.TimeToDel2
  39. print "[PARAMETERS] - SIZE_MAX_TO_UPLOAD=%d" %ParametrosServer.SizeMaxToUpload
  40. print "[PARAMETERS] - Log File =%s" %ParametrosServer.LogFileName
  41. print "[PARAMETERS] - Debug Level =%d" %ParametrosServer.DebugLevel