forked from pool/python-JsonWeb
Accepting request 341801 from home:mimi_vx
Quickly add JSON encoding/decoding to your python objects. OBS-URL: https://build.opensuse.org/request/show/341801 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-JsonWeb?expand=0&rev=1
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
||||
3
JsonWeb-0.8.2.tar.gz
Normal file
3
JsonWeb-0.8.2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:edc70578c2ddc48e58a640ca23ed010c0fcd0e7d5ccc4b507ce996b3a393a662
|
||||
size 22733
|
||||
5
python-JsonWeb.changes
Normal file
5
python-JsonWeb.changes
Normal file
@@ -0,0 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 28 17:34:29 UTC 2015 - mimi.vx@gmail.com
|
||||
|
||||
- initial commit
|
||||
|
||||
71
python-JsonWeb.spec
Normal file
71
python-JsonWeb.spec
Normal file
@@ -0,0 +1,71 @@
|
||||
#
|
||||
# spec file for package python-JsonWeb
|
||||
#
|
||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: python-JsonWeb
|
||||
Version: 0.8.2
|
||||
Release: 0
|
||||
Summary: Quickly add json serialization and deserialization to your python classes
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Languages/Python
|
||||
Url: http://www.jsonweb.info/
|
||||
Source: https://pypi.python.org/packages/source/J/JsonWeb/JsonWeb-%{version}.tar.gz
|
||||
BuildRequires: python-coverage
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-nose
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
JsonWeb
|
||||
========
|
||||
Add JSON (de)serialization to your python objects :
|
||||
|
||||
>>> from jsonweb import decode, encode
|
||||
>>> @encode.to_object()
|
||||
... @decode.from_object()
|
||||
... class User(object):
|
||||
... def __init__(self, nick, email):
|
||||
... self.nick = nick
|
||||
... self.email = email
|
||||
>>> json_str = encode.dumper(User("cool_user123", "cool_user123@example.com"))
|
||||
>>> print json_str
|
||||
{"nick": "cool_user123", "__type__": "User", "email": "cool_user123@example.com"}
|
||||
>>> user = decode.loader(json_str)
|
||||
>>> print user.nick
|
||||
cool_user123
|
||||
>>> print user
|
||||
<User object at 0x10145e390>
|
||||
|
||||
%prep
|
||||
%setup -q -n JsonWeb-%{version}
|
||||
|
||||
%build
|
||||
python setup.py build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
|
||||
%check
|
||||
nosetests
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc README.rst
|
||||
%{python_sitelib}/*
|
||||
|
||||
%changelog
|
||||
Reference in New Issue
Block a user