Merge lp:~patrickmwright/mago/patrickmw-struct into lp:mago

Proposed by Patrick Wright
Status: Merged
Merged at revision: 18
Proposed branch: lp:~patrickmwright/mago/patrickmw-struct
Merge into: lp:mago
Diff against target: 25 lines (+21/-0)
1 file modified
mago/struct.py (+21/-0)
To merge this branch: bzr merge lp:~patrickmwright/mago/patrickmw-struct
Reviewer Review Type Date Requested Status
Nagappan Alagappan Approve
Jean-Baptiste Pending
Review via email: mp+46998@code.launchpad.net

Description of the change

Added a new struct module to allow dot notation app map

To post a comment you must log in.
Revision history for this message
Nagappan Alagappan (nagappan) wrote :

Looks okay to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'mago/struct.py'
--- mago/struct.py 1970-01-01 00:00:00 +0000
+++ mago/struct.py 2011-01-20 23:44:27 +0000
@@ -0,0 +1,21 @@
1# Copyright (C) 2011 Canonical Ltd
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17class Struct():
18 def __getattr__(self, name):
19 return self.name if hasattr(self, name) else setattr(self, name, None)
20
21

Subscribers

People subscribed via source and target branches