1
0
mirror of https://github.com/gryf/slack-backup.git synced 2025-12-17 03:20:25 +01:00

Dropping Python 2 support

This commit is contained in:
2016-11-26 19:12:44 +01:00
parent 11241e9d8b
commit af7f24e9a9
8 changed files with 12 additions and 41 deletions

View File

@@ -1,8 +1,6 @@
language: python
env:
- TOXENV=py27
- TOXENV=py34
- TOXENV=py27-flake8
- TOXENV=py34-flake8
install: pip install tox
script: tox

View File

@@ -14,8 +14,8 @@ as a log.
Requirements
------------
This project is written in Python 2.7, and 3.4+, although version 2.7, which
should work, wasn't tested as extensively as it should be.
This project is written in Python 3, 3.4 to be precise, although it may work on
earlier version of Python3. Sorry no support for Python2.
Other than that, required packages are as follows:

View File

@@ -2,12 +2,15 @@
"""
Setup for the slack-backup project
"""
from distutils.core import setup
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name="slack-backup",
packages=["slack_backup"],
version="0.2",
version="0.3",
description="Make copy of slack converstaions",
author="Roman Dobosz",
author_email="gryf73@gmail.com",

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This module contains emoji list
"""

View File

@@ -1,19 +1,14 @@
# -*- coding: utf-8 -*-
"""
Reporters module.
There are several classes for specific format reporting, and also some of the
slack conversation/convention parsers.
"""
from __future__ import absolute_import, division, print_function
import os
import errno
import html.parser
import logging
import re
try:
from html.parser import HTMLParser
except ImportError:
from HTMLParser import HTMLParser
from slack_backup import objects as o
from slack_backup import utils
@@ -269,7 +264,7 @@ class TextReporter(Reporter):
def _remove_entities(self, text):
"""replace html entites into appropriate chars"""
text = HTMLParser().unescape(text)
return html.parser.HTMLParser().unescape(text)
def _filter_slackid(self, text):
"""filter out all of the id from slack"""

View File

@@ -1,8 +1,5 @@
from unittest import TestCase
try:
from unittest.mock import MagicMock
except ImportError:
from mock import MagicMock
from unittest.mock import MagicMock
from slack_backup import client
from slack_backup import objects as o

View File

@@ -1,10 +1,5 @@
# -*- coding: utf-8 -*-
from unittest import TestCase
try:
from unittest.mock import MagicMock
except ImportError:
from mock import MagicMock
from unittest.mock import MagicMock
from slack_backup import reporters as r
@@ -45,7 +40,3 @@ class TestReporter(TestCase):
text = ('<@U111BBBBB|user2>Praesent vel enim sed eros luctus '
'imperdiet.\nMauris neque ante, <@U111DDDDD> placerat at, '
'mollis vitae, faucibus quis, <@U111CCCCC>leo. Ut feugiat.')
# Praesent vel enim sed eros luctus imperdiet. Vivamus urna quam, congue
# vulputate, convallis non, cursus cursus, risus. Quisque aliquet. Donec
# vulputate egestas elit. Morbi dictum, sem sit amet aliquam.

14
tox.ini
View File

@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,{py27,py34}-flake8
envlist = py34,py34-flake8
usedevelop = True
@@ -10,18 +10,6 @@ commands = py.test --cov=slack_backup --cov-report=term-missing
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py27]
usedevelop={[testenv]usedevelop}
setenv = {[testenv]setenv}
commands = {[testenv]commands}
deps = {[testenv]deps}
mock
[testenv:py27-flake8]
basepython = python2.7
deps = flake8
commands = flake8 {posargs}
[testenv:py34-flake8]
basepython = python3.4
deps = flake8