Skip to content

Commit

Permalink
fixed issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
burbilog committed Jul 13, 2019
1 parent e36bc38 commit 2889a2b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.0.3] - 2019-07-13
## Changed
- Fixed issue #2, windows version did not work because file paths had mixed
slashes and backslashes. File path must be normalized with os.path.normpath()

## [1.0.2] - 2018-10-25
## Added
- Enforced Python version 2

## [1.0.1] - 2018-03-12
### Added
- Deduplication mechanism with `--nodedup` flag.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ w:
win32: build32 zip32

build32:
wine pyinstaller --onefile scrapbook2zotero.py
wine pyinstaller --onefile --hiddenimport=rdflib scrapbook2zotero.py

zip32:
cd dist && zip scrapbook2zotero-$(shell git describe --abbrev=4 --dirty --always --tags).zip scrapbook2zotero.exe
Expand Down
4 changes: 2 additions & 2 deletions scrapbook2zotero.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def export_node(node, source_dir, tagchain, counter, deduplicator):
<rdf:resource rdf:resource="{1}"/>
<dc:title>{2}</dc:title>
<link:type>application/pdf</link:type>
</z:Attachment>""".format(pdf_resource, basedir + '/' + pdfname, pdfname)
</z:Attachment>""".format(pdf_resource, os.path.normpath(basedir + '/' + pdfname), pdfname)
pdf_links += u'\n <link:link rdf:resource="#item_{0}"/>'.format(
pdf_resource)
debug("pdf attachment '%s' added to '%s'" % (pdfname, node.nodeid))
Expand Down Expand Up @@ -438,7 +438,7 @@ def export_node(node, source_dir, tagchain, counter, deduplicator):
<z:linkMode>1</z:linkMode>
<link:type>text/html</link:type>
</z:Attachment>""".format(node.nodeid, # {0}
indexfname, # {1}
os.path.normpath(indexfname), # {1}
ampersand(node.source), # {2}
nodetime_formatted, # {3}
ampersand(node.name) # {4}
Expand Down
3 changes: 2 additions & 1 deletion test_s2z.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def test_4_win32():
subprocess.check_call(["wine", "dist/scrapbook2zotero.exe",
"scrapbook_test_data", "tmp/test-windows-crlf.rdf"])
subprocess.check_call(["dos2unix", "-n", "tmp/test-windows-crlf.rdf", "tmp/test-windows.rdf"])
assert filecmp.cmp("samples/standard.rdf", "tmp/test-windows.rdf")
# standard-windows.rdf is like standard.rdf but with '/' replaced by '\' in file paths
assert filecmp.cmp("samples/standard-windows.rdf", "tmp/test-windows.rdf")

def test_5_nocoll():
""" Testing disabling of collection exports (--nocoll flag) """
Expand Down

0 comments on commit 2889a2b

Please sign in to comment.