Skip to content

Commit

Permalink
clean up code format
Browse files Browse the repository at this point in the history
  • Loading branch information
jdillard committed Sep 13, 2019
1 parent 944ffef commit 1ab3c64
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sphinx_gitstamp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ def page_context_handler(app, pagename, templatename, context, doctree):
# that involves getting the source/output pair into the extension.
return

context['gitstamp'] = datetime.datetime
.strptime(updated, "%Y-%m-%d").strftime(app.config.gitstamp_fmt)
context['gitstamp'] = datetime.datetime.strptime(
updated,
"%Y-%m-%d"
).strftime(
app.config.gitstamp_fmt
)
except git.exc.GitCommandError:
# File doesn't exist or something else went wrong.
raise errors.ExtensionError("Can't fetch git history for %s.rst. Is \
DOCSRC set correctly? (DOCSRC=%s)" % (fullpagename, docsrc))
raise errors.ExtensionError("Can't fetch git history for %s.rst." %
fullpagename)
except ValueError:
# Datestamp can't be parsed.
app.info("%s: Can't parse datestamp () %s ) for gitstamp, output \
Expand Down

0 comments on commit 1ab3c64

Please sign in to comment.