Commit ce649c0d by Szabolcs Gelencser Committed by Szabolcs Gelencsér

Add windows support

parent d72aa9c8
......@@ -48,3 +48,5 @@ scripts.rc
circle/celery
circle/circle/db.sqlite3
.idea
venv
\ No newline at end of file
......@@ -113,7 +113,12 @@ try:
except:
systz = None
TIME_ZONE = get_env_variable('DJANGO_TIME_ZONE', default=systz)
WINDOWS = get_env_variable('WINDOWS', False)
if WINDOWS:
TIME_ZONE = 'Europe/Budapest'
else:
TIME_ZONE = get_env_variable('DJANGO_TIME_ZONE', default=systz)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
LANGUAGE_CODE = get_env_variable("DJANGO_LANGUAGE_CODE", "en")
......@@ -439,23 +444,25 @@ LOGGING = {
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'syslog': {
'level': 'INFO',
'class': 'logging.handlers.SysLogHandler',
'formatter': 'simple',
'address': '/dev/log',
# 'socktype': SOCK_STREAM,
# 'address': ('host', '514'),
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins', 'syslog'],
'handlers': ['mail_admins',],
'level': 'INFO',
'propagate': True,
},
}
}
if WINDOWS:
LOGGING['handlers']['syslog'] = {
'level': 'INFO',
'class': 'logging.handlers.SysLogHandler',
'formatter': 'simple',
'address': '/dev/log',
# 'socktype': SOCK_STREAM,
# 'address': ('host', '514'),
}
LOGGING['loggers']['django.request']['handlers'] += 'syslog'
########## END LOGGING CONFIGURATION
......
......@@ -17,7 +17,6 @@
import subprocess
import os
import pyinotify
from django.core.management.base import BaseCommand
from django.conf import settings
......@@ -39,6 +38,10 @@ class LessUtils(object):
print("Compiling: %s" % os.path.basename(less_pathname))
try:
if settings.WINDOWS:
import sys
subprocess.Popen([sys.executable, cmd])
else:
subprocess.check_output(cmd)
except subprocess.CalledProcessError as e:
print(e.output)
......@@ -69,6 +72,7 @@ class LessUtils(object):
""" Watches for changes in LESS files recursively from the
project's root and compiles the files
"""
import pyinotify
wm = pyinotify.WatchManager()
class EventHandler(pyinotify.ProcessEvent):
......@@ -99,5 +103,6 @@ class Command(BaseCommand):
print("\n%s\n" % ("=" * 30))
print("End of initial LESS compiles\n")
if not settings.WINDOWS:
# after first run watch less files
LessUtils.start_watch()
......@@ -97,7 +97,6 @@ pyasn1==0.4.2
pycparser==2.18
pycryptodomex==3.4.12
Pygments==2.0.2
pyinotify==0.9.5
PyNaCl==1.2.1
pyOpenSSL==17.5.0
pyotp==2.1.1
......@@ -131,7 +130,6 @@ subprocess32==3.2.7
traitlets==4.3.2
unicodecsv==0.14.1
urllib3==1.22
uWSGI==2.0.13.1
warlock==1.3.0
wcwidth==0.1.7
WebOb==1.7.4
......
-r circlestack.txt
pyinotify==0.9.5
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment