#!/usr/bin/env python3

### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; version 2 only
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
### MA 02110-1301 USA.

import sys

### Extremely dodgy solution for running python2 or python3 versions
### of the unoconv script

### This is needed since LibreOffice is providing its own python3
### bundled package since 4.x series

### A much more proper solution would be to modify the code so it
### would be compatible with both versions or, if not possible, to
### create real python modules out of the code and import them in a
### proper way

if __name__ == '__main__':
    if sys.version_info < (3,0):
        from unoconv2 import run
    else:
        from unoconv3 import run

    run()
