Browse Source

Drop unsupported Python 2.6 and 3.2

pull/76/head
hugovk 5 years ago
parent
commit
5d126c5496
  1. 8
      .travis.yml
  2. 2
      OleFileIO_PL.py
  3. 2
      doc/Install.rst
  4. 33
      install.bat
  5. 2
      olefile/__init__.py
  6. 18
      olefile/olefile.py
  7. 2
      setup.py
  8. 7
      tests/test_olefile.py

8
.travis.yml

@ -2,9 +2,7 @@ language: python
python:
- pypy
- pypy3
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- 3.5
@ -14,11 +12,7 @@ python:
sudo: false
install:
- if [ "$TRAVIS_PYTHON_VERSION" == "2.6" ]; then pip install unittest2; fi
# Coverage 4.0 doesn't support Python 3.2
- if [ "$TRAVIS_PYTHON_VERSION" == "3.2" ]; then pip install "coverage<4"; fi
- if [ "$TRAVIS_PYTHON_VERSION" != "3.2" ]; then pip install coverage; fi
- pip install coverage
script:
- coverage run --source=olefile -m nose tests

2
OleFileIO_PL.py

@ -4,7 +4,7 @@ olefile (formerly OleFileIO_PL)
Module to read/write Microsoft OLE2 files (also called Structured Storage or
Microsoft Compound Document File Format), such as Microsoft Office 97-2003
documents, Image Composer and FlashPix files, Outlook messages, ...
This version is compatible with Python 2.6+ and 3.x
This version is compatible with Python 2.7 and 3.3+
Project website: https://www.decalage.info/olefile

2
doc/Install.rst

@ -5,7 +5,7 @@ How to Download and Install olefile
Pre-requisites
--------------
olefile requires Python 2.6, 2.7 or 3.x.
olefile requires Python 2.7 or 3.3+.
Download and Install

33
install.bat

@ -34,39 +34,6 @@ if errorlevel 1 goto error
goto end
:NOTPY27
REM Python 2.6:
c:\python26\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy26
echo Python.exe found in C:\Python26
c:\python26\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY26
c:\python25\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy25
echo Python.exe found in C:\Python25
c:\python25\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY25
c:\python24\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy24
echo Python.exe found in C:\Python24
c:\python24\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY24
c:\python23\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy23
echo Python.exe found in C:\Python23
c:\python23\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY23
"c:\program files\python\python.exe" --version >NUL 2>&1
if errorlevel 1 goto notpf
echo Python.exe found in C:\Program Files\Python

2
olefile/__init__.py

@ -4,7 +4,7 @@ olefile (formerly OleFileIO_PL)
Module to read/write Microsoft OLE2 files (also called Structured Storage or
Microsoft Compound Document File Format), such as Microsoft Office 97-2003
documents, Image Composer and FlashPix files, Outlook messages, ...
This version is compatible with Python 2.6+ and 3.x
This version is compatible with Python 2.7 and 3.3+
Project website: https://www.decalage.info/olefile

18
olefile/olefile.py

@ -4,7 +4,7 @@ olefile (formerly OleFileIO_PL)
Module to read/write Microsoft OLE2 files (also called Structured Storage or
Microsoft Compound Document File Format), such as Microsoft Office 97-2003
documents, Image Composer and FlashPix files, Outlook messages, ...
This version is compatible with Python 2.6+ and 3.x
This version is compatible with Python 2.7 and 3.3+
Project website: https://www.decalage.info/olefile
@ -22,11 +22,11 @@ Copyright (c) 1995-2009 by Fredrik Lundh
See source code and LICENSE.txt for information on usage and redistribution.
"""
# Since OleFileIO_PL v0.30, only Python 2.6+ and 3.x is supported
# Since OleFileIO_PL v0.45, only Python 2.7 and 3.3+ is supported
# This import enables print() as a function rather than a keyword
# (main requirement to be compatible with Python 3.x)
# The comment on the line below should be printed on Python 2.5 or older:
from __future__ import print_function # This version of olefile requires Python 2.6+ or 3.x.
from __future__ import print_function # This version of olefile requires Python 2.7 or 3.3+.
#--- LICENSE ------------------------------------------------------------------
@ -158,16 +158,6 @@ else:
# === LOGGING =================================================================
class NullHandler(logging.Handler):
"""
Log Handler without output, to avoid printing messages if logging is not
configured by the main application.
Python 2.7 has logging.NullHandler, but this is necessary for 2.6:
see https://docs.python.org/2.6/library/logging.html#configuring-logging-for-a-library
"""
def emit(self, record):
pass
def get_logger(name, level=logging.CRITICAL+1):
"""
Create a suitable logger object for this module.
@ -190,7 +180,7 @@ def get_logger(name, level=logging.CRITICAL+1):
logger = logging.getLogger(name)
# only add a NullHandler for this logger, it is up to the application
# to configure its own logging:
logger.addHandler(NullHandler())
logger.addHandler(logging.NullHandler())
logger.setLevel(level)
return logger

2
setup.py

@ -43,10 +43,8 @@ classifiers=[
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",

7
tests/test_olefile.py

@ -1,10 +1,5 @@
from __future__ import print_function
try:
import unittest2 as unittest # Python 2.6
except ImportError:
import unittest
import unittest
import OleFileIO_PL as OleFileIO

Loading…
Cancel
Save