Skip to content

Commit 5bd1d5a

Browse files
committed
javaobj is now a package
__init__ ensures that imports from javaobj work as before
1 parent 448b452 commit 5bd1d5a

File tree

4 files changed

+78
-9
lines changed

4 files changed

+78
-9
lines changed

javaobj/__init__.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/python
2+
# -- Content-Encoding: utf-8 --
3+
"""
4+
Provides functions for reading and writing (writing is WIP currently) Java
5+
objects serialized or will be deserialized by ObjectOutputStream. This form of
6+
object representation is a standard data interchange format in Java world.
7+
8+
javaobj module exposes an API familiar to users of the standard library
9+
marshal, pickle and json modules.
10+
11+
See:
12+
http://download.oracle.com/javase/6/docs/platform/serialization/spec/protocol.html
13+
14+
:authors: Volodymyr Buell, Thomas Calmant
15+
:license: Apache License 2.0
16+
:version: 0.3.0
17+
:status: Alpha
18+
19+
..
20+
21+
Copyright 2019 Thomas Calmant
22+
23+
Licensed under the Apache License, Version 2.0 (the "License");
24+
you may not use this file except in compliance with the License.
25+
You may obtain a copy of the License at
26+
27+
http://www.apache.org/licenses/LICENSE-2.0
28+
29+
Unless required by applicable law or agreed to in writing, software
30+
distributed under the License is distributed on an "AS IS" BASIS,
31+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32+
See the License for the specific language governing permissions and
33+
limitations under the License.
34+
"""
35+
36+
# Imports giving access to what the javaobj module provides
37+
from javaobj.javaobj import *
38+
39+
# ------------------------------------------------------------------------------
40+
41+
# Documentation strings format
42+
__docformat__ = "restructuredtext en"

javaobj.py renamed to javaobj/javaobj.py

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/python
2-
# -- Content-Encoding: UTF-8 --
2+
# -- Content-Encoding: utf-8 --
33
"""
44
Provides functions for reading and writing (writing is WIP currently) Java
55
objects serialized or will be deserialized by ObjectOutputStream. This form of
@@ -13,12 +13,12 @@
1313
1414
:authors: Volodymyr Buell, Thomas Calmant
1515
:license: Apache License 2.0
16-
:version: 0.2.3
16+
:version: 0.3.0
1717
:status: Alpha
1818
1919
..
2020
21-
Copyright 2016 Thomas Calmant
21+
Copyright 2019 Thomas Calmant
2222
2323
Licensed under the Apache License, Version 2.0 (the "License");
2424
you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@
4040
import struct
4141
import sys
4242

43-
from modifiedutf8 import decode_modified_utf8
43+
from javaobj.modifiedutf8 import decode_modified_utf8
4444

4545
try:
4646
# Python 2
@@ -51,8 +51,33 @@
5151

5252
# ------------------------------------------------------------------------------
5353

54+
__all__ = (
55+
"__version_info__",
56+
"__version__",
57+
"DefaultObjectTransformer",
58+
"JavaArray",
59+
"JavaByteArray",
60+
"JavaClass",
61+
"JavaEnum",
62+
"JavaObject",
63+
"JavaObjectConstants",
64+
"JavaObjectMarshaller",
65+
"JavaObjectUnmarshaller",
66+
"JavaString",
67+
"OpCodeDebug",
68+
"decode_modified_utf8",
69+
"dumps",
70+
"load",
71+
"loads",
72+
"log_debug",
73+
"log_error",
74+
"read_to_str",
75+
"to_bytes",
76+
"to_str",
77+
)
78+
5479
# Module version
55-
__version_info__ = (0, 2, 3)
80+
__version_info__ = (0, 3, 0)
5681
__version__ = ".".join(str(x) for x in __version_info__)
5782

5883
# Documentation strings format
File renamed without changes.

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
88
:authors: Volodymyr Buell, Thomas Calmant
99
:license: Apache License 2.0
10-
:version: 0.2.4
10+
:version: 0.3.0
1111
:status: Alpha
1212
1313
..
1414
15-
Copyright 2016 Thomas Calmant
15+
Copyright 2019 Thomas Calmant
1616
1717
Licensed under the Apache License, Version 2.0 (the "License");
1818
you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@
3737
# ------------------------------------------------------------------------------
3838

3939
# Module version
40-
__version_info__ = (0, 2, 4)
40+
__version_info__ = (0, 3, 0)
4141
__version__ = ".".join(str(x) for x in __version_info__)
4242

4343
# Documentation strings format
@@ -55,6 +55,7 @@ def read(fname):
5555

5656
# ------------------------------------------------------------------------------
5757

58+
5859
setup(
5960
name="javaobj-py3",
6061
version=__version__,
@@ -66,7 +67,7 @@ def read(fname):
6667
description="Module for serializing and de-serializing Java objects.",
6768
license='Apache License 2.0',
6869
keywords="python java marshalling serialization",
69-
py_modules=['javaobj'],
70+
packages=['javaobj'],
7071
test_suite="tests.tests",
7172
long_description=read('README.rst'),
7273
classifiers=[
@@ -77,5 +78,6 @@ def read(fname):
7778
'Programming Language :: Python :: 3.4',
7879
'Programming Language :: Python :: 3.5',
7980
'Programming Language :: Python :: 3.6',
81+
'Programming Language :: Python :: 3.7',
8082
"Topic :: Software Development :: Libraries :: Python Modules",
8183
])

0 commit comments

Comments
 (0)