Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: python
python:
- "3.6.6"
# command to install dependencies
install:
- pip install -r requirements-dev.txt
# command to run tests
script:
- flake8 sdiff tests
- nosetests
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.2.0 (2018-08-21)
------------------

- Upgrade to python 3.6

0.1.3 (2015-08-13)
------------------

Expand Down
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Some simple testing tasks (sorry, UNIX only).

PYTHON=venv/bin/python3
PSERVE=venv/bin/gunicorn --paste
PIP=venv/bin/pip
EI=venv/bin/easy_install
NOSE=venv/bin/nosetests
FLAKE=venv/bin/flake8
FLAGS=
Expand All @@ -21,17 +19,14 @@ install:
$(PYTHON) ./setup.py install

flake:
$(FLAKE) event_pipe tests
$(FLAKE) sdiff tests

test: flake
$(NOSE) -s $(FLAGS)

vtest:
$(NOSE) -s -v $(FLAGS)

testloop:
while sleep 1; do $(NOSE) -s $(FLAGS); done

cov cover coverage:
$(NOSE) -s --with-cover --cover-html --cover-html-dir ./coverage $(FLAGS)
echo "open file://`pwd`/coverage/index.html"
Expand Down
Binary file removed docs/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion sdiff/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .parser import parse
from .renderer import TextRenderer
from .compare import diff_struct, diff_links
from .compare import diff_struct, diff_links # noqa


def diff(md1, md2, renderer=TextRenderer()):
Expand Down
4 changes: 1 addition & 3 deletions sdiff/compare.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import re
import logging
from difflib import SequenceMatcher
from itertools import zip_longest

from .parser import parse
from .tree_utils import traverse
from .errors import DeleteError, InsertError
from .model import Text
from .tree_utils import traverse

logger = logging.getLogger(__name__)

Expand Down
4 changes: 1 addition & 3 deletions sdiff/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def parse_reflink(self, m):

def _process_link(self, m):
line = m.group(0)
text = m.group(1)
if line[0] == '!':
node = Image(line)
else:
Expand Down Expand Up @@ -89,7 +88,6 @@ def parse_newline(self, m):

def parse_heading(self, m):
level = len(m.group(1))
text = m.group(0)
node = Header(level)
node.add_nodes(self._parse_inline(m.group(2)))
self.tokens.append(node)
Expand Down Expand Up @@ -146,7 +144,7 @@ def _process_list_item(self, cap, bull):
pattern = re.compile(r'^ {1,%d}' % space, flags=re.M)
item = pattern.sub('', item)

# determin whether item is loose or not
# determine whether item is loose or not
loose = _next
if not loose and re.search(r'\n\n(?!\s*$)', item):
loose = True
Expand Down
4 changes: 3 additions & 1 deletion sdiff/tree_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ def traverse(tree, include_symbols=None, exclude_symbols=None):
continue
yield node
previous = node
children = reversed(list(filter(lambda i: _ignore_node(i, include_symbols, exclude_symbols), node.nodes)))

child_list = [i for i in node.nodes if _ignore_node(i, include_symbols, exclude_symbols)]
children = reversed(child_list)
stack.extendleft(children)
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages


version = '0.2.2'
version = '0.3.0'


def read(f):
Expand All @@ -28,5 +28,5 @@ def read(f):
packages=find_packages(exclude=['tests']),
package_data={},
namespace_packages=[],
install_requires = install_requires,
include_package_data = False)
install_requires=install_requires,
include_package_data=False)