+from SfaData import PlanetLabData
+
+class PopupRecord(PopupPanel):
+ def __init__(self, record):
+ PopupPanel.__init__(self, True)
+ contents = HTML("<pre>" + record + "</pre>")
+ self.setWidget(contents)
+
+ self.setStyleName("ks-popups-Popup")
+
+class SfaItem(TreeItem):
+ def __init__(self, hrn, kind):
+ self.kind = kind
+ self.hrn = hrn
+ last = hrn.split('.')[-1]
+ if self.kind == "(authority)":
+ self.label = "<b>%s</b>" % last
+ elif self.kind == "(slice)":
+ self.label = "<u><i>%s</i></u>" % last
+ elif self.kind == "(user)":
+ self.label = "%s" % last
+ else:
+ self.label = "<b>%s</b>" % last
+
+ TreeItem.__init__(self, self.label)
+
+ if self.kind == "(authority)":
+ self.addItem(PendingItem())
+
+class PendingItem(TreeItem):
+ def __init__(self):
+ TreeItem.__init__(self, "Please wait...")
+
+ def isPendingItem(self):
+ return True