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

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

Subscribers

People subscribed via source and target branches