Last active
December 15, 2015 18:48
-
-
Save olasd/5306064 to your computer and use it in GitHub Desktop.
Debian suite data structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
class Suite(object): | |
def __init__(self, name, maps_to=None): | |
self.name = name | |
self.maps_to = maps_to | |
@property | |
def real_suite(self): | |
suite = self | |
while suite.maps_to: | |
suite = suite.maps_to | |
return suite | |
def __unicode__(self): | |
return u"%s%s" % (self.name, u"" if not self.maps_to else u" (→ %s)" % self.real_suite) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment