Просмотр исходного кода

#702: cleanup and exclude defaults.py

Rafał Pitoń 8 лет назад
Родитель
Сommit
9e92a41971
2 измененных файлов с 40 добавлено и 26 удалено
  1. 1 1
      cleansource
  2. 39 25
      misago/conf/defaults.py

+ 1 - 1
cleansource

@@ -1,5 +1,5 @@
 #!/bin/bash
 
-yapf -ir misago -e '*/project_template/**/*.py'
+yapf -ir misago -e '*/project_template/**/*.py' -e '*/conf/defaults.py'
 isort -rc misago
 pylint misago

+ 39 - 25
misago/conf/defaults.py

@@ -6,10 +6,6 @@ If you rely on any of those in your code, make sure you use `misago.conf.setting
 instead of Django's `django.conf.settings`.
 """
 
-# Default JS debug to false
-# This setting used exclusively by test runner and isn't part of public API
-
-_MISAGO_JS_DEBUG = False
 
 # Permissions system extensions
 # https://misago.readthedocs.io/en/latest/developers/acls.html#extending-permissions-system
@@ -27,16 +23,19 @@ MISAGO_ACL_EXTENSIONS = [
     'misago.search.permissions',
 ]
 
+
 # Custom markup extensions
 
 MISAGO_MARKUP_EXTENSIONS = []
 
+
 # Posting middlewares
 # https://misago.readthedocs.io/en/latest/developers/posting_process.html
 
 MISAGO_POSTING_MIDDLEWARES = [
     # Always keep FloodProtectionMiddleware middleware first one
     'misago.threads.api.postingendpoint.floodprotection.FloodProtectionMiddleware',
+
     'misago.threads.api.postingendpoint.category.CategoryMiddleware',
     'misago.threads.api.postingendpoint.privatethread.PrivateThreadMiddleware',
     'misago.threads.api.postingendpoint.reply.ReplyMiddleware',
@@ -59,6 +58,7 @@ MISAGO_POSTING_MIDDLEWARES = [
     'misago.threads.api.postingendpoint.emailnotification.EmailNotificationMiddleware',
 ]
 
+
 # Configured thread types
 
 MISAGO_THREAD_TYPES = [
@@ -66,6 +66,7 @@ MISAGO_THREAD_TYPES = [
     'misago.threads.threadtypes.privatethread.PrivateThread',
 ]
 
+
 # Search extensions
 
 MISAGO_SEARCH_EXTENSIONS = [
@@ -73,11 +74,13 @@ MISAGO_SEARCH_EXTENSIONS = [
     'misago.users.search.SearchUsers',
 ]
 
+
 # Misago-admin specific date formats
 
 MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH = 'j M'
 MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH_YEAR = 'M \'y'
 
+
 # Additional registration validators
 # https://misago.readthedocs.io/en/latest/developers/validating_registrations.html
 
@@ -86,20 +89,24 @@ MISAGO_NEW_REGISTRATIONS_VALIDATORS = [
     'misago.users.validators.validate_with_sfs',
 ]
 
+
 # Stop Forum Spam settings
 
 MISAGO_USE_STOP_FORUM_SPAM = True
 MISAGO_STOP_FORUM_SPAM_MIN_CONFIDENCE = 80
 
+
 # Login API URL
 
 MISAGO_LOGIN_API_URL = 'auth'
 
+
 # Misago Admin Path
 # Omit starting and trailing slashes. To disable Misago admin, empty this value.
 
 MISAGO_ADMIN_PATH = 'admincp'
 
+
 # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
 
 MISAGO_ADMIN_NAMESPACES = [
@@ -107,68 +114,82 @@ MISAGO_ADMIN_NAMESPACES = [
     'misago:admin',
 ]
 
+
 # How long (in minutes) since previous request to admin namespace should admin session last.
 
 MISAGO_ADMIN_SESSION_EXPIRATION = 60
 
+
 # Display threads on forum index
 # Change this to false to display categories list instead
 
 MISAGO_THREADS_ON_INDEX = True
 
+
 # Max age of notifications in days
 # Notifications older than this are deleted. On very active forums its better to keep this smaller.
 
 MISAGO_NOTIFICATIONS_MAX_AGE = 40
 
+
 # Fail-safe limits in case forum is raided by spambot
 # No user may exceed those limits, however you may disable them by changing them to 0.
 
 MISAGO_DIALY_POST_LIMIT = 600
 MISAGO_HOURLY_POST_LIMIT = 100
 
+
 # Function used for generating individual avatar for user
 
 MISAGO_DYNAMIC_AVATAR_DRAWER = 'misago.users.avatars.dynamic.draw_default'
 
+
 # Path to directory containing avatar galleries
 # Those galleries can be loaded by running loadavatargallery command
 
 MISAGO_AVATAR_GALLERY = None
 
+
 # Save user avatars for sizes
 # Keep sizes ordered from greatest to smallest
 # Max size also controls min size of uploaded image as well as crop size
 
 MISAGO_AVATARS_SIZES = [400, 200, 150, 100, 64, 50, 30]
 
+
 # Path to blank avatar image used for guests and removed users.
 
 MISAGO_BLANK_AVATAR = 'blank-avatar.png'
 
+
 # Threads lists pagination settings
 
 MISAGO_THREADS_PER_PAGE = 25
 MISAGO_THREADS_TAIL = 15
 
+
 # Posts lists pagination settings
 
 MISAGO_POSTS_PER_PAGE = 18
 MISAGO_POSTS_TAIL = 6
 
+
 # Number of events displayed on single thread page
 # If there's more events than specified, oldest events will be trimmed
 
 MISAGO_EVENTS_PER_PAGE = 20
 
+
 # Number of attachments possible to assign to single post
 
 MISAGO_POST_ATTACHMENTS_LIMIT = 16
 
+
 # Max allowed size of image before Misago will generate thumbnail for it
 
 MISAGO_ATTACHMENT_IMAGE_SIZE_LIMIT = (500, 500)
 
+
 # Length of secret used for attachments url tokens and filenames
 
 MISAGO_ATTACHMENT_SECRET_LENGTH = 64
@@ -178,12 +199,14 @@ MISAGO_ATTACHMENT_SECRET_LENGTH = 64
 
 MISAGO_ATTACHMENT_ORPHANED_EXPIRE = 24 * 60
 
+
 # Names of files served when user requests file that doesn't exist or is unavailable
 # Those files will be sought within STATIC_ROOT directory
 
 MISAGO_404_IMAGE = 'misago/img/error-404.png'
 MISAGO_403_IMAGE = 'misago/img/error-403.png'
 
+
 # Controls max age in days of items that Misago has to process to make rankings
 # Used for active posters and most liked users lists
 # If your forum runs out of memory when trying to generate users rankings list
@@ -196,10 +219,12 @@ MISAGO_RANKING_LENGTH = 30
 
 MISAGO_RANKING_SIZE = 50
 
+
 # Controls number of users displayed on single page
 
 MISAGO_USERS_PER_PAGE = 12
 
+
 # Controls amount of data used by readtracking system
 # Items older than number of days specified below are considered read
 # Depending on amount of new content being posted on your forum you may want
@@ -207,14 +232,12 @@ MISAGO_USERS_PER_PAGE = 12
 
 MISAGO_READTRACKER_CUTOFF = 40
 
+
 # Available Moment.js locales
 
 MISAGO_MOMENT_JS_LOCALES = [
     'af',
-    'ar-ma',
-    'ar-sa',
-    'ar-tn',
-    'ar',
+    'ar-ma', 'ar-sa', 'ar-tn', 'ar',
     'az',
     'be',
     'bg',
@@ -227,12 +250,9 @@ MISAGO_MOMENT_JS_LOCALES = [
     'cv',
     'cy',
     'da',
-    'de-at',
-    'de',
+    'de-at', 'de',
     'el',
-    'en-au',
-    'en-ca',
-    'en-gb',
+    'en-au', 'en-ca', 'en-gb',
     'eo',
     'es',
     'et',
@@ -247,8 +267,7 @@ MISAGO_MOMENT_JS_LOCALES = [
     'he',
     'hi',
     'hr',
-    'hu',
-    'hy-am',
+    'hu', 'hy-am',
     'id',
     'is',
     'it',
@@ -262,32 +281,27 @@ MISAGO_MOMENT_JS_LOCALES = [
     'mk',
     'ml',
     'mr',
-    'ms-my',
-    'my',
+    'ms-my', 'my',
     'nb',
     'ne',
     'nl',
     'nn',
     'pl',
-    'pt-br',
-    'pt',
+    'pt-br', 'pt',
     'ro',
     'ru',
     'sk',
     'sl',
     'sq',
-    'sr-cyrl',
-    'sr',
+    'sr-cyrl', 'sr',
     'sv',
     'ta',
     'th',
     'tl-ph',
     'tr',
-    'tzm-latn',
-    'tzm',
+    'tzm-latn', 'tzm',
     'uk',
     'uz',
     'vi',
-    'zh-cn',
-    'zh-tw',
+    'zh-cn', 'zh-tw',
 ]