Skip to content
This repository was archived by the owner on Jan 22, 2020. It is now read-only.

Commit f69f151

Browse files
committed
style(livingdocs): remove unused imports and pep8 cleanup
1 parent a9b3d50 commit f69f151

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/livingdocs/hugo_doc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from PIL import Image
21
from io import StringIO
32
from datetime import datetime
4-
import os
53

64

75
class HugoDoc(object):

src/livingdocs/maker.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1+
from .hugo_doc import HugoDoc
2+
13
from PIL import Image
2-
from io import StringIO
3-
from datetime import datetime
44
from slugify import UniqueSlugify
55
import os
66

77
slugger = UniqueSlugify()
88

9-
from .hugo_doc import HugoDoc
10-
119

1210
class DocsMaker(object):
1311
"""A documentation site maker."""
12+
1413
def __init__(self, section):
1514
self.section = section
16-
self.output_dir = '%s/livingdocs/content/%s' % (os.getcwd(), self.section)
15+
self.output_dir = '%s/livingdocs/content/%s' % (
16+
os.getcwd(), self.section)
1717

1818
def fix_filename(self, s):
1919
parts = s.split('/')
@@ -38,7 +38,8 @@ def start_feature(self, context, feature):
3838
def end_feature(self, context, feature):
3939
# calculate the number of scenarios
4040
self.doc.meta['num_scenarios'] = len(feature.scenarios)
41-
self.doc.meta['num_scenarios_passing'] = len([s for s in feature.scenarios if s.status == 'passed'])
41+
self.doc.meta['num_scenarios_passing'] = len(
42+
[s for s in feature.scenarios if s.status == 'passed'])
4243

4344
# write an index.md file for all the info we've accumulated about
4445
# this feature
@@ -69,19 +70,22 @@ def end_step(self, context, step):
6970

7071
# get the screenshot
7172
try:
72-
context.browser.driver.get_screenshot_as_file('%s/%s/%s' % (self.output_dir, self.doc.path, shot_name))
73+
context.browser.driver.get_screenshot_as_file(
74+
'%s/%s/%s' % (self.output_dir, self.doc.path, shot_name))
7375
except:
7476
shot_name = None
7577
image_code = 'error capturing'
7678

7779
# make a thumbnail of it
7880
if shot_name:
79-
im = Image.open('%s/%s/%s' % (self.output_dir, self.doc.path, shot_name))
81+
im = Image.open('%s/%s/%s' %
82+
(self.output_dir, self.doc.path, shot_name))
8083
im.thumbnail((100, 100))
8184
im.save('%s/%s/%s' % (self.output_dir, self.doc.path, thumb_name))
8285

83-
image_code = '<a href="%s"><img class="img-thumbnail" src="%s" width="100" /></a>' % (shot_name, thumb_name)
86+
image_code = '<a href="%s"><img class="img-thumbnail" src="%s" width="100" /></a>' % (
87+
shot_name, thumb_name)
8488

8589
# write the step information to file
86-
self.doc.writeline(u'%s %s | %s | %0.2f | %s' % (step.keyword, step.name, step.status, step.duration, image_code))
87-
90+
self.doc.writeline(u'%s %s | %s | %0.2f | %s' % (
91+
step.keyword, step.name, step.status, step.duration, image_code))

0 commit comments

Comments
 (0)