Skip to content

Instantly share code, notes, and snippets.

@olasd

olasd/suite.py

Last active Dec 15, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.