Skip to content

Commit

Permalink
Releasing 0.8 (#428)
Browse files Browse the repository at this point in the history
* Releasing 0.8

* Releasing 0.8.2

Fixing a PyPI upload
  • Loading branch information
regebro authored and dagwieers committed Jan 7, 2018
1 parent 86a47a3 commit 28742eb
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
@@ -1,8 +1,7 @@
# Change Log

## [Unreleased](https://github.com/dagwieers/unoconv/tree/HEAD)

[Full Changelog](https://github.com/dagwieers/unoconv/compare/0.7...HEAD)
## [0.8](https://github.com/dagwieers/unoconv/tree/0.8) (2017-12-07)
[Full Changelog](https://github.com/dagwieers/unoconv/compare/0.7...0.8)

**Implemented enhancements:**

Expand Down Expand Up @@ -58,6 +57,7 @@
**Merged pull requests:**

- \* make -F switch working for user-defined fields [\#426](https://github.com/dagwieers/unoconv/pull/426) ([belegnar](https://github.com/belegnar))
- Updated Changelog and docs [\#422](https://github.com/dagwieers/unoconv/pull/422) ([regebro](https://github.com/regebro))
- Added setup.py [\#421](https://github.com/dagwieers/unoconv/pull/421) ([regebro](https://github.com/regebro))
- Drop support for v3.3 and v3.4 [\#413](https://github.com/dagwieers/unoconv/pull/413) ([regebro](https://github.com/regebro))
- pass the password as openoffice expects it, so it will work for docum… [\#358](https://github.com/dagwieers/unoconv/pull/358) ([monomelodies](https://github.com/monomelodies))
Expand Down
5 changes: 4 additions & 1 deletion ChangeLog
@@ -1,4 +1,7 @@
* 0.8 - unreleased
* 0.8.2 - released 2017-12-07
- Fixed PyPI upload

* 0.8 - released 2017-12-07
- Add option -M/--meta to add or update document metadata during conversion
- Add option -I/--input-filter-name to specify input format (Martijn van de Streek)
- Added setup.py to support standard Python installs, like pip, etc.
Expand Down
15 changes: 15 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,15 @@
include *.adoc
include *.md
include AUTHORS
include COPYING
include ChangeLog
include Makefile
recursive-include ci *.bash
recursive-include doc *.1
recursive-include doc *.adoc
recursive-include doc Makefile
recursive-include packaging *.spec
recursive-include tests *.csv
recursive-include tests *.gif
recursive-include tests *.odt
recursive-include tests Makefile
72 changes: 67 additions & 5 deletions setup.py
Expand Up @@ -5,20 +5,82 @@
def adoc2rst(text):
levels = '=-~.^'
lines = text.split('\n')
# Flags:
codeblock = 0
bullet = ''
indent = 0

result = []
for line in lines:
# Get rid of extra whitespace
line = line.strip()
line = line.rstrip()
new_indent = len(line) - len(line.strip())

if not line:
result.append(line)
if not line.strip():
if not result or result[-1].strip():
result.append(line)
continue
elif line[0] == '=':
# This is a header
header = line.rstrip('=')
level = len(line) - len(header)
header = header.strip()
header = header.strip('= ')
result.append(header)
result.append(levels[level] * len(header))
result.append('')
indent = 0
codeblock = 0
continue
elif line == '----':
# Code block

if codeblock == 0:
codeblock = 1
result.append('.. code-block::')
result.append('')
elif codeblock == 1:
# End of code
codeblock = 0
elif codeblock == 2:
# We have a '----' codeblock after a '::' codeblock:
codeblock = 1

continue
elif line.strip()[0] in '-*+':
# Bullet list
# It's NOT code, even if the line before ended in colon
if codeblock == 2:
codeblock = 0
for x in (-1, -2):
if result[x].endswith(':'):
result[x] = result[x][:-1]

new_bullet = line.strip()[0]
if not bullet or bullet[-1] != new_bullet:
# New list
bullet = bullet + new_bullet
elif new_indent < indent:
# Outdent (but not a bullet)
if bullet:
if bullet != line.strip()[0]:
bullet = bullet[:-1]
# Bullets must end with a blank line:
result.append('')
indent = new_indent
if new_indent == 0:
codeblock = 0

if new_indent > indent:
indent = new_indent

if codeblock:
line = ' ' + line

if line and line[-1] == ':':
line += ':'
codeblock = 2 # Type 2 codeblock

result.append(line)

return '\n'.join(result)

Expand All @@ -28,7 +90,7 @@ def adoc2rst(text):


setup(name = "unoconv",
version = "0.7",
version = "0.8.2",
author = "Dag Wieers",
author_email = "dag.wieers@gmail.com",
url = "https://github.com/dagwieers/unoconv",
Expand Down
2 changes: 1 addition & 1 deletion unoconv
Expand Up @@ -25,7 +25,7 @@ import subprocess
import sys
import time

__version__ = '0.7'
__version__ = '0.8.2'

doctypes = ('document', 'graphics', 'presentation', 'spreadsheet')

Expand Down

0 comments on commit 28742eb

Please sign in to comment.