def __init__(self, shortid, locale='', version='', code='', dll='', name=''): self.shortid = shortid self.locale = locale self.version = version self.code = MsdnSourceCode(code, shortid) self.dll = dll self.name = name self.code_ptr = 0
class MsdnCodeSnippet(object): def __init__(self, shortid, locale='', version='', code='', dll='', name=''): self.shortid = shortid self.locale = locale self.version = version self.code = MsdnSourceCode(code, shortid) self.dll = dll self.name = name self.code_ptr = 0 def set_alternate(self, alt_str): try: self.locale, self.version = alt_str.split(";") except (AttributeError, ValueError): pass def __repr__(self): string = "%s,%s,%s;%s,%s,%s" % (self.shortid, self.name, self.locale, self.version, self.dll, self.code) return string def __str__(self): return self.code.__str__()