make skeleton semi-functional by wrapping json
diff --git a/.gitignore b/.gitignore
index 916746a..a819ef5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
build
+dist
*.pyc
*.pyc.d
*.py,cover
diff --git a/json5/lib.py b/json5/lib.py
index 2e5c6fe..0f339a2 100644
--- a/json5/lib.py
+++ b/json5/lib.py
@@ -12,17 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-def load():
- pass
+import json
+
+def load(fp, **kwargs):
+ return json.load(fp, **kwargs)
-def loads():
- pass
+def loads(s, **kwargs):
+ return json.loads(s, **kwargs)
-def dump():
- pass
+def dump(obj, fp, **kwargs):
+ return json.dump(obj, fp, **kwargs)
-def dumps():
- pass
+def dumps(obj, **kwargs):
+ return json.dumps(obj, **kwargs)
diff --git a/json5/main.py b/json5/main.py
index 4a641c5..11cba15 100644
--- a/json5/main.py
+++ b/json5/main.py
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import fileinput
+import json
import os
import sys
@@ -30,6 +32,9 @@
if args.version:
host.print_(VERSION)
+
+ inp = '\n'.join(fileinput.input(args.files))
+ host.print_(lib.dumps(lib.loads(inp)))
return 0
diff --git a/json5/version.py b/json5/version.py
index 9f917eb..6900f53 100644
--- a/json5/version.py
+++ b/json5/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-VERSION = '0.1.0'
+VERSION = '0.1.1'
diff --git a/run b/run
index 5269b35..22fff41 100755
--- a/run
+++ b/run
@@ -39,7 +39,6 @@
subp = subps.add_parser('coverage',
help='Run the tests and report code coverage.')
subp.set_defaults(func=run_coverage)
- cov.add_arguments(subp)
subp = subps.add_parser('develop',
help='Install a symlinked package locally.')
diff --git a/setup.py b/setup.py
index f0abd6c..7a1404d 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@
if here not in sys.path:
sys.path.insert(0, here)
-from typ.version import VERSION
+from json5.version import VERSION
with open(os.path.join(here, 'README.md')) as fp:
readme = fp.read().strip()
@@ -29,12 +29,12 @@
readme_lines = readme.splitlines()
setup(
- name='typ',
+ name='json5',
packages=find_packages(),
package_data={'': ['../README.md']},
entry_points={
'console_scripts': [
- 'json5=json5.runner:main',
+ 'json5=json5.main:main',
]
},
install_requires=[
@@ -47,9 +47,9 @@
url='https://github.com/dpranke/pyjson5',
license='Apache',
classifiers=[
- 'Development Status :: 3 - Alpha',
+ 'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
- 'License :: OSI Approved :: Apache',
+ 'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',