Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 Update #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/pythontest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python Test

on:
push:
branches:
- '**'
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Lint
run: |
pip install pylint
pylint -rn --errors-only ./smpp
- name: Test
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
pip install coveralls pytest-cov
pytest --cov=smpp tests/
coveralls
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

5 changes: 1 addition & 4 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@ Copyright 2009-2010 Mozes, Inc.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied.
See the License for the specific language governing permissions and
limitations under the License.

With the exception of namedtuple.py which is licensed under the Python
Software Foundation license: http://www.opensource.org/licenses/PythonSoftFoundation
limitations under the License.
16 changes: 10 additions & 6 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
smpp.pdu is a Python library for parsing Protocol Data Units (PDUs) in SMPP protocol
# smpp.pdu

smpp.pdu is a Python library for parsing Protocol Data Units (PDUs) in SMPP protocol
http://www.nowsms.com/discus/messages/1/24856.html

[![Tests](https://github.com/DomAmato/smpp.pdu/workflows/Python%20Test/badge.svg)](https://github.com/DomAmato/smpp.pdu/actions)
[![Coverage Status](https://coveralls.io/repos/github/DomAmato/smpp.pdu/badge.svg?branch=master)](https://coveralls.io/github/DomAmato/smpp.pdu?branch=master)

Examples
========

Decoding (parsing) PDUs
--------------------------
import binascii
import StringIO
from io import BytesIO
from smpp.pdu.pdu_encoding import PDUEncoder

hex = '0000004d00000005000000009f88f12441575342440001013136353035353531323334000101313737333535353430373000000000000000000300117468657265206973206e6f2073706f6f6e'
binary = binascii.a2b_hex(hex)
file = StringIO.StringIO(binary)
file = BytesIO(binary)

pdu = PDUEncoder().decode(file)
print "PDU: %s" % pdu
print("PDU: %s" % pdu)

# Prints the following:
#
Expand Down Expand Up @@ -63,11 +67,11 @@ Creating and encoding PDUs
data_coding=DataCoding(DataCodingScheme.GSM_MESSAGE_CLASS, DataCodingGsmMsg(DataCodingGsmMsgCoding.DEFAULT_ALPHABET, DataCodingGsmMsgClass.CLASS_2)),
short_message='HELLO',
)
print "PDU: %s" % pdu
print("PDU: %s" % pdu)

binary = PDUEncoder().encode(pdu)
hexStr = binascii.b2a_hex(binary)
print "HEX: %s" % hexStr
print("HEX: %s" % hexStr)

# Prints the following:
#
Expand Down
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

18 changes: 8 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
import os
from setuptools import setup, find_packages
from pkg_resources import resource_string

from setuptools import setup, find_packages

setup(
name = "smpp.pdu",
version = "0.3",
author = "Roger Hoover",
author_email = "roger.hoover@gmail.com",
description = "Library for parsing Protocol Data Units (PDUs) in SMPP protocol",
license = 'Apache License 2.0',
packages = find_packages(),
long_description=resource_string(__name__, 'README.markdown'),
packages = find_packages(exclude=["tests"]),
keywords = "smpp pdu",
url = "https://github.com/mozes/smpp.pdu",
py_modules=["smpp.pdu"],
include_package_data = True,
package_data={'smpp.pdu': ['README.markdown']},
zip_safe = False,
install_requires = [
'enum',
],
test_suite = 'smpp.pdu.tests',
zip_safe = False,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Topic :: System :: Networking",
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Programming Language :: Python",
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
"Topic :: Software Development :: Libraries :: Python Modules",
],
)
Expand Down
2 changes: 1 addition & 1 deletion smpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Loading