|
|
@ -5,16 +5,8 @@ from datetime import datetime |
|
|
|
import dateutil.parser |
|
|
|
import pypandoc |
|
|
|
|
|
|
|
try: |
|
|
|
# python2 |
|
|
|
from urllib.request import urlopen |
|
|
|
from urllib.error import URLError, HTTPError |
|
|
|
from urllib.parse import urlencode |
|
|
|
from urllib.parse import urlparse, urlunparse |
|
|
|
except ImportError: |
|
|
|
# python3 |
|
|
|
from urllib.parse import urlparse, urlunparse, urlencode, quote |
|
|
|
from urllib.request import urlopen, URLError, HTTPError |
|
|
|
from urllib.parse import urlparse, urlunparse, urlencode, quote |
|
|
|
from urllib.request import urlopen, URLError, HTTPError |
|
|
|
|
|
|
|
from jinja2 import FileSystemLoader, Environment |
|
|
|
from etherpump.commands.common import * |
|
|
@ -25,7 +17,7 @@ import dateutil.parser |
|
|
|
publication: |
|
|
|
Generate a single document from etherpumps using a template. |
|
|
|
|
|
|
|
Built-in templates: publication.html |
|
|
|
Built-in templates: publication.html |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
@ -118,7 +110,7 @@ def main (args): |
|
|
|
pg.add_argument("--prev", default=None, help="prev link, default: None") |
|
|
|
|
|
|
|
args = p.parse_args(args) |
|
|
|
|
|
|
|
|
|
|
|
tmpath = args.templatepath |
|
|
|
# Default path for template is the built-in data/templates |
|
|
|
if tmpath == None: |
|
|
@ -155,11 +147,11 @@ def main (args): |
|
|
|
ret['versions'] = [wrappath(x) for x in paths] |
|
|
|
lastedited = None |
|
|
|
for p in paths: |
|
|
|
mtime = os.stat(p).st_mtime |
|
|
|
mtime = os.stat(p).st_mtime |
|
|
|
if lastedited == None or mtime > lastedited: |
|
|
|
lastedited = mtime |
|
|
|
ret["lastedited_iso"] = datetime.fromtimestamp(lastedited).strftime("%Y-%m-%dT%H:%M:%S") |
|
|
|
ret["lastedited_raw"] = mtime |
|
|
|
ret["lastedited_raw"] = mtime |
|
|
|
return ret |
|
|
|
|
|
|
|
def loadmeta(p): |
|
|
@ -225,7 +217,7 @@ def main (args): |
|
|
|
if p: |
|
|
|
if not has_version(p, x): |
|
|
|
print ("Grouping file {0} with pad {1}".format(x, p['padid']), file=sys.stderr) |
|
|
|
p['versions'].append(wrappath(x)) |
|
|
|
p['versions'].append(wrappath(x)) |
|
|
|
else: |
|
|
|
print ("Skipping existing version {0} ({1})...".format(x, p['padid']), file=sys.stderr) |
|
|
|
removelist.append(x) |
|
|
@ -263,7 +255,7 @@ def main (args): |
|
|
|
elif args.order == "custom": |
|
|
|
|
|
|
|
# TODO: make this list non-static, but a variable that can be given from the CLI |
|
|
|
|
|
|
|
|
|
|
|
customorder = [ |
|
|
|
'nooo.relearn.preamble', |
|
|
|
'nooo.relearn.activating.the.archive', |
|
|
|