rpms/python-bunch/F-12 python-bunch.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Toshio くらとみ toshio at fedoraproject.org
Wed May 12 09:44:53 UTC 2010


Author: toshio

Update of /cvs/pkgs/rpms/python-bunch/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv23164/F-12

Modified Files:
	.cvsignore sources 
Added Files:
	python-bunch.spec 
Log Message:
Initial import



--- NEW FILE python-bunch.spec ---
%if 0%{fedora} <= 12
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif

%global srcname bunch

Name:           python-bunch
Version:        1.0.0
Release:        1%{?dist}
Summary:        Python dictionary with attribute-style access

Group:          Development/Languages
License:        MIT
URL:            http://tire.less.ly/hacking/bunch
Source0:        http://pypi.python.org/packages/source/b/bunch/bunch-1.0.0.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  dos2unix
%if 0%{?fedora} > 12 || 0%{?rhel}
BuildRequires: python-setuptools
%else
BuildRequires: python-setuptools-devel
%endif

%description
python-bunch provides a python class which can perform as a dict whose keys are
also accessible as attributes, similar to JavaScript objects.  For instance::

  >>> import bunch
  >>> people = bunch.Bunch({'alice': 'here', 'bob': 'there'})
  >>> print people['alice'], people.alice
  here here

The piece of python-bunch that sets it apart from similar modules found inside
other projects is the bunchify() function which recursively converts from
a dict to a Bunch::

  >>> multi_level = {'array': ['scalar', {'mapping': 'to show recursion'} ]}
  >>> bunch.bunchify(multi_level)
  Bunch(array=['scalar', Bunch(mapping='to show recursion')])

%prep
%setup -q -n %{srcname}-%{version}
dos2unix LICENSE.txt README.txt

%build
%{__python} setup.py build


%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}
rm %{buildroot}%{python_sitelib}/bunch/test.*

%clean
rm -rf %{buildroot}

%check
PYTHONPATH=build/lib python build/lib/bunch/test.py

%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt
%{python_sitelib}/*


%changelog
* Fri Mar 19 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 1.0.0-1
- Initial Fedora Build


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/python-bunch/F-12/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	11 May 2010 04:52:13 -0000	1.1
+++ .cvsignore	12 May 2010 09:44:53 -0000	1.2
@@ -0,0 +1 @@
+bunch-1.0.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/python-bunch/F-12/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	11 May 2010 04:52:13 -0000	1.1
+++ sources	12 May 2010 09:44:53 -0000	1.2
@@ -0,0 +1 @@
+944d2e8f222ed032961daa34c5b5151c  bunch-1.0.0.tar.gz



More information about the scm-commits mailing list