forked from github/pelican
tasks.py.jinja2: optimize imports
When opening the generated tasks.py file with a Python linter enabled, some imports will be marked as unecessary depending on the options passed to pelican-quickstart. Add if statements around the optional imports so they are used only when necessary.
This commit is contained in:
parent
bb0ed26fdd
commit
2d375bc135
1 changed files with 4 additions and 0 deletions
|
|
@ -2,11 +2,15 @@ import os
|
||||||
import shlex
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
{% if github %}
|
||||||
import datetime
|
import datetime
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
from invoke import task
|
from invoke import task
|
||||||
from invoke.main import program
|
from invoke.main import program
|
||||||
|
{% if cloudfiles %}
|
||||||
from invoke.util import cd
|
from invoke.util import cd
|
||||||
|
{% endif %}
|
||||||
from pelican import main as pelican_main
|
from pelican import main as pelican_main
|
||||||
from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
|
from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
|
||||||
from pelican.settings import DEFAULT_CONFIG, get_settings_from_file
|
from pelican.settings import DEFAULT_CONFIG, get_settings_from_file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue