From 86e36715f1ba661ff40c3a5eb8a0299604c15f72 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Wed, 8 Feb 2017 13:20:14 -0600 Subject: [PATCH] Set up for Travis --- .editorconfig | 15 +++++++++++++++ .flake8 | 7 +++++++ .travis.yml | 12 ++++++++++++ cover.py | 1 + epub.py | 1 + leech.py | 1 - sites/ao3.py | 2 +- sites/fanfictionnet.py | 1 + 8 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .editorconfig create mode 100644 .flake8 create mode 100644 .travis.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0eb366a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.py] +indent_style = space +indent_size = 4 +charset = utf-8 + +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..b54fd1e --- /dev/null +++ b/.flake8 @@ -0,0 +1,7 @@ +[flake8] +ignore = + # E128 continuation line under-indented for visual indent + # E128, + # E501 line too long + E501 +exclude = .git,__pycache__,venv diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f42831b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: python +python: + - "3.3" + +install: + - pip install -r requirements.txt + - pip install flake8 + - npm install eclint + +script: + - flake8 . + - eclint check . diff --git a/cover.py b/cover.py index 0aafad5..5291a36 100644 --- a/cover.py +++ b/cover.py @@ -28,6 +28,7 @@ def make_cover(title, author, width=600, height=800, fontname="Helvetica", fonts output.seek(0) return output + if __name__ == '__main__': f = make_cover('Test of a Title which is quite long and will require multiple lines', 'Some Dude') with open('output.png', 'wb') as out: diff --git a/epub.py b/epub.py index 5d15879..92596e1 100644 --- a/epub.py +++ b/epub.py @@ -148,5 +148,6 @@ def make_epub(filename, html_files, meta, extra_files=False, compress=True): return filename + if __name__ == '__main__': make_epub('test.epub', [('Chapter 1', 'test/a.html'), ('Chapter 2', 'test/b.html')], {}) diff --git a/leech.py b/leech.py index 3f684cb..744cc6e 100755 --- a/leech.py +++ b/leech.py @@ -5,7 +5,6 @@ import sys import json import datetime import http.cookiejar -import collections import sites import epub diff --git a/sites/ao3.py b/sites/ao3.py index 587a4ee..7d8b825 100644 --- a/sites/ao3.py +++ b/sites/ao3.py @@ -2,7 +2,7 @@ import datetime import re -from . import register, Site, SiteException, Section, Chapter +from . import register, Site, Section, Chapter @register diff --git a/sites/fanfictionnet.py b/sites/fanfictionnet.py index f20c711..c7bca60 100644 --- a/sites/fanfictionnet.py +++ b/sites/fanfictionnet.py @@ -75,6 +75,7 @@ class FanFictionNet(Site): return text.prettify() + @register class FictionPress(FanFictionNet): @staticmethod