Skip to content
Permalink
Browse files
Making plugins basically compatible (loghandlers is gone).
  • Loading branch information
felixfontein committed Jun 16, 2017
1 parent 2060982 commit 1391c48f49c48da2a54bb71804e98f320599123e
@@ -30,7 +30,7 @@
from blinker import signal

from nikola.plugin_categories import SignalHandler
from nikola.utils import get_logger
from nikola.utils import get_logger, STDERR_HANDLER


class DeployHooks(SignalHandler):
@@ -58,7 +58,7 @@ def run_hooks(self, event):

def set_site(self, site):
self.site = site
self.logger = get_logger(self.name, self.site.loghandlers)
self.logger = get_logger(self.name, STDERR_HANDLER)

ready = signal('deployed')
ready.connect(self.run_hooks)
@@ -33,7 +33,7 @@
import dateutil.tz

from nikola.plugin_categories import Command
from nikola.utils import get_logger
from nikola.utils import get_logger, STDERR_HANDLER

if sys.version_info[0] == 2:
import robotparser as robotparser
@@ -56,7 +56,7 @@ class Iarchiver(Command):

def _execute(self, command, args):

self.logger = get_logger('iarchiver', self.site.loghandlers)
self.logger = get_logger('iarchiver', STDERR_HANDLER)

""" /robots.txt must be in root, so this use of urljoin() is intentional """
iatestbot = robotparser.RobotFileParser(urljoin(self.site.config['SITE_URL'], "/robots.txt"))
@@ -31,7 +31,7 @@
import sys

from nikola.plugin_categories import Command
from nikola.utils import get_logger
from nikola.utils import get_logger, STDERR_HANDLER


class Ping(Command):
@@ -45,7 +45,7 @@ class Ping(Command):

def _execute(self, command, args):

self.logger = get_logger('ping', self.site.loghandlers)
self.logger = get_logger('ping', STDERR_HANDLER)

timestamp_path = os.path.join(self.site.config['CACHE_FOLDER'], 'lastping')
new_ping = datetime.utcnow()
@@ -44,7 +44,7 @@ class BuildSass(Task):

def gen_tasks(self):
"""Generate CSS out of Sass sources."""
self.logger = utils.get_logger('build_sass', self.site.loghandlers)
self.logger = utils.get_logger('build_sass', utils.STDERR_HANDLER)
self.compiler_name = self.site.config['SASS_COMPILER']
self.compiler_options = self.site.config['SASS_OPTIONS']

@@ -61,7 +61,7 @@ def set_site(self, site):

def gen_tasks(self):

self.logger = utils.get_logger('speechsynthesizednetcast', self.site.loghandlers)
self.logger = utils.get_logger('speechsynthesizednetcast', utils.STDERR_HANDLER)

# Deps and config
kw = {
@@ -50,7 +50,7 @@ class UpgradeMetadata(Command):
fields = ('title', 'slug', 'date', 'tags', 'link', 'description', 'type')

def _execute(self, options, args):
L = utils.get_logger('upgrade_metadata', self.site.loghandlers)
L = utils.get_logger('upgrade_metadata', utils.STDERR_HANDLER)
nikola.post._UPGRADE_METADATA_ADVERTISED = True

# scan posts
@@ -34,7 +34,7 @@
workdir = None

from nikola.plugin_categories import Command
from nikola.utils import get_logger, req_missing
from nikola.utils import get_logger, req_missing, STDERR_HANDLER


def get_path_list(path):
@@ -59,7 +59,7 @@ class CommandVCS(Command):
def _execute(self, options, args):
if workdir is None:
req_missing(['anyvc'], 'use the anyvc plugin')
logger = get_logger('vcs', self.site.loghandlers)
logger = get_logger('vcs', STDERR_HANDLER)
self.site.scan_posts()

repo_path = local('.')

0 comments on commit 1391c48

Please sign in to comment.