only load pyfilesystem in debug mode

This commit is contained in:
HelloZeroNet 2015-03-11 16:25:29 +01:00
parent 5b5c8acdcb
commit ed9237f610

View file

@ -1,13 +1,16 @@
import logging, os, sys, time import logging, os, sys, time
import threading import threading
from Config import config
if config.debug: # Only load pyfilesytem if using debug mode
try: try:
from fs.osfs import OSFS from fs.osfs import OSFS
pyfilesystem = OSFS("src") pyfilesystem = OSFS("src")
except Exception, err: except Exception, err:
logging.info("%s: For autoreload please download pyfilesystem (https://code.google.com/p/pyfilesystem/)" % err) logging.debug("%s: For autoreload please download pyfilesystem (https://code.google.com/p/pyfilesystem/)" % err)
pyfilesystem = False
else:
pyfilesystem = False pyfilesystem = False
class DebugReloader: class DebugReloader:
def __init__ (self, callback, directory = "/"): def __init__ (self, callback, directory = "/"):