Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f59fc75

Browse files
committedAug 23, 2015
Making pep257 happy.
1 parent bd83ee3 commit f59fc75

14 files changed

+24
-20
lines changed
 

‎nikola/nikola.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1433,16 +1433,15 @@ def clean_task_paths(self, task):
14331433
return task
14341434

14351435
def get_task_stages(self):
1436-
"""Returns list of stages."""
1436+
"""Return list of stages."""
14371437
return sorted(list(self.task_stages.keys()))
14381438

14391439
def get_stage_plugin_objects(self, stage):
1440-
"""Returns all plugin objects for a given stage."""
1440+
"""Return all plugin objects for a given stage."""
14411441
return self.task_stages[stage]
14421442

14431443
def gen_task(self, name, plugin_object):
14441444
"""Generate tasks for a specific plugin object."""
1445-
14461445
def flatten(task):
14471446
"""Flatten lists of tasks."""
14481447
if isinstance(task, dict):

‎nikola/plugin_categories.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def gen_tasks(self):
173173
raise NotImplementedError()
174174

175175
def gen_target_regex(self):
176-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
176+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
177177
return ".*"
178178

179179
def group_task(self):
@@ -186,6 +186,7 @@ def group_task(self):
186186

187187

188188
class EarlyTask(BaseTask):
189+
189190
"""Plugins of this type are task generators which are executed before tasks are generated."""
190191

191192
name = "dummy_task"
@@ -249,9 +250,12 @@ class TaskMultiplier(BasePlugin):
249250
name = "dummy multiplier"
250251

251252
def extend_target_regex(self, target_regex):
252-
"""Given a regex matching potential targets, returns a regex matching all
253+
"""Extend target regex to match multiplied tasks.
254+
255+
Given a regex matching potential targets, returns a regex matching all
253256
potential targets generated by this plugin from target names matching the
254-
given regex."""
257+
given regex.
258+
"""
255259
return None
256260

257261
def process(self, task):

‎nikola/plugins/task/bundles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def set_site(self, site):
5555
super(BuildBundles, self).set_site(site)
5656

5757
def gen_target_regex(self):
58-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
58+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
5959
if not self.site.config['USE_BUNDLES']:
6060
return ''
6161
import re

‎nikola/plugins/task/copy_assets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CopyAssets(Task):
4242
name = "copy_assets"
4343

4444
def gen_target_regex(self):
45-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
45+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
4646
import re
4747
return re.escape(os.path.join(self.site.config['OUTPUT_FOLDER'], 'assets', '')) + '.*'
4848

‎nikola/plugins/task/copy_files.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CopyFiles(Task):
3939
name = "copy_files"
4040

4141
def gen_target_regex(self):
42-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
42+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
4343
regexes = []
4444
import re
4545
import os.path

‎nikola/plugins/task/galleries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Galleries(Task, ImageProcessor):
6464
dates = {}
6565

6666
def gen_target_regex(self):
67-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
67+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
6868
regexes = []
6969
import re
7070
import os.path

‎nikola/plugins/task/gzip.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ class GzipFiles(TaskMultiplier):
4242
is_default = True
4343

4444
def extend_target_regex(self, target_regex):
45-
"""Given a regex matching potential targets, returns a regex matching all
46-
potential targets generated by this plugin from target names matching the
47-
given regex."""
45+
"""Extend target regex to match multiplied tasks."""
4846
return target_regex + '\\.gz'
4947

5048
def process(self, task, prefix):

‎nikola/plugins/task/listings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def set_site(self, site):
109109
return super(Listings, self).set_site(site)
110110

111111
def gen_target_regex(self):
112-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
112+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
113113
regexes = []
114114
import re
115115
import os.path

‎nikola/plugins/task/posts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class RenderPosts(Task):
5050
name = "render_posts"
5151

5252
def gen_target_regex(self):
53-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
53+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
5454
import re
5555
import os.path
5656
return re.escape(os.path.join(self.site.config['CACHE_FOLDER'], '')) + '.*' + '\\.html'

‎nikola/plugins/task/redirect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Redirect(Task):
4141
name = "redirect"
4242

4343
def gen_target_regex(self):
44-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
44+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
4545
regexes = []
4646
import os.path
4747
import re

‎nikola/plugins/task/robots.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RobotsFile(LateTask):
4545
name = "robots_file"
4646

4747
def gen_target_regex(self):
48-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
48+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
4949
import os.path
5050
import re
5151
return re.escape(os.path.join(self.site.config["OUTPUT_FOLDER"], "robots.txt"))

‎nikola/plugins/task/scale_images.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ScaleImage(Task, ImageProcessor):
4040
name = "scale_images"
4141

4242
def gen_target_regex(self):
43-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
43+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
4444
regexes = []
4545
import re
4646
import os.path

‎nikola/plugins/task/scan_posts.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,23 @@
2424
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2525
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2626

27+
"""Scans for posts and pages."""
28+
2729
from __future__ import unicode_literals
2830

2931
from nikola.plugin_categories import BaseTask
3032

3133

3234
class ScanPosts(BaseTask):
35+
3336
"""Just scans for posts."""
3437

3538
name = "scan_posts"
3639

3740
stage = 0
3841

3942
def gen_target_regex(self):
40-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
43+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
4144
return ""
4245

4346
def gen_tasks(self):

‎nikola/plugins/task/sources.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Sources(Task):
4040
name = "render_sources"
4141

4242
def gen_target_regex(self):
43-
"""Returns a regex which matches all targets generated by this task, and hopefully nothing else."""
43+
"""Return a regex which matches all targets generated by this task, and hopefully nothing else."""
4444
if self.site.config['COPY_SOURCES']:
4545
import re
4646
return re.escape(os.path.join(self.site.config["OUTPUT_FOLDER"], '')) + ".*"

0 commit comments

Comments
 (0)
Please sign in to comment.