Skip to content

Instantly share code, notes, and snippets.

@olasd
Last active December 15, 2015 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olasd/5306064 to your computer and use it in GitHub Desktop.
Save olasd/5306064 to your computer and use it in GitHub Desktop.
Debian suite data structure
# -*- 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