def __init__(self, *lines, **option): __View__.__init__(self, 'ctst_slide', lines=L(*lines), opts=M(seriesBarDistance=5), labels=L(), series=L(), size=5, anima=False) if len(self.lines) > 0: for l in self.lines: self.series << L() self.add = self.__addMapped__ else: self.add = self.__addLinear__ self.opts['distributeSeries'] = True self._link = self.__create_link__(option['link']) if 'link' in option else '' self._title = '<h3 class="cw-css-elem-title">%s</h3>' % option['title'] if 'title' in option else '' if 'height' in option: self.opts['height'] = str(option['height']) + 'px'
def __init__(self, *heads, **option): __View__.__init__( self, 'table', heads=L(*heads), recs=L(), _stripe=option['stripe'] if 'stripe' in option else False, _link=self.__create_link__(option['link']) if 'link' in option else '') self._title = '<h3 class="cw-css-elem-title">%s</h3>' % option[ 'title'] if 'title' in option else ''
def __init__(self, chart_name, *lines, **option): __View__.__init__(self, chart_name, lines=L(*lines), opts=M(), data=L()) if len(self.lines) == 0: self.lines << 'Data' self._link = self.__create_link__( option['link']) if 'link' in option else '' self._title = '<h3 class="cw-css-elem-title">%s</h3>' % option[ 'title'] if 'title' in option else '' self._height = ' style="height:%dpx"' % option[ 'height'] if 'height' in option else ''
def __init__(self, view, *widths): __View__.__init__(self, 'layout_col', view=view) self._widths = L() if len(widths) > 0: for width in widths: if instof(width, tuple): self._widths << width else: self._widths << ('lg', 12)
def __init__(self, **option): __View__.__init__(self, 'morr_donut', data=L()) self._link = self.__create_link__( option['link']) if 'link' in option else '' self._title = '<h3 class="cw-css-elem-title">%s</h3>' % option[ 'title'] if 'title' in option else '' self._height = ' style="height:%dpx"' % option[ 'height'] if 'height' in option else ''
def add(self, *cols, **option): rec = M(cols=L(*cols)) rec['type'] = ''' class="%s"''' % option[ 'type'] if 'type' in option else '' rec['link'] = self.__create_link__( option['link']) if 'link' in option else '' rec['did'] = self.__create_del__( option['did']) if 'did' in option else '' self.recs << rec return self
def __load_features__(self): self.products = M() self.products['_porder'] = L() greg('PRODUCTS', self.products) for p in PRODUCT_ORDER: self.products._porder << p.lower() p_paths = Dir.showall('product/') for p_path in p_paths: if not Dir.isDir(p_path) or not Dir.isDir(p_path): continue p_raw = os.path.split(p_path)[-1] p_name = p_raw.lower() p_code = p_name p_url = '/' + p_name + '/' p_title = p_raw.replace('_', ' ') self.products[p_name] = M() self.products[p_name]['_name'] = p_name self.products[p_name]['_code'] = p_code self.products[p_name]['_url'] = p_url self.products[p_name]['_title'] = p_title # Add-on Feature features = NameSpace(p_path, inherited=nameof(Feature)) for f_raw, f_mod in iterkv(features): f_name = f_raw.lower() f_code = p_code + '_' + f_name f_url = p_url + f_name + '/' f_title = f_raw.replace('_', ' ') for cls_code, cls_obj in iterkv(f_mod): if classof(cls_obj, Feature) and not classof( cls_obj, SubFeature) and nameof(cls_obj) != nameof(Feature): self.products[p_name][f_name] = cls_obj.NEW() self.products[p_name][f_name]['_term'] = True self.products[p_name][f_name]['_name'] = f_name self.products[p_name][f_name]['_code'] = f_code self.products[p_name][f_name]['_url'] = f_url self.products[p_name][f_name]['_title'] = f_title if cls_obj.__doc__ != None: self.products[p_name][f_name][ '_desc'] = ' ' + cls_obj.__doc__ if cls_obj.__doc__ == None: self.products[p_name][f_name]['_desc'] = '' break for cls_raw, cls_obj in iterkv(f_mod): if classof(cls_obj, SubFeature ) and nameof(cls_obj) != nameof(SubFeature): cls_name = cls_raw.lower() cls_code = f_code + '_' + cls_name cls_url = f_url + cls_name + '/' cls_title = cls_raw.replace('_', ' ') self.products[p_name][f_name]['_term'] = False self.products[p_name][f_name][cls_name] = cls_obj.NEW() self.products[p_name][f_name][cls_name]['_term'] = True self.products[p_name][f_name][cls_name][ '_name'] = cls_name self.products[p_name][f_name][cls_name][ '_code'] = cls_code self.products[p_name][f_name][cls_name][ '_url'] = cls_url self.products[p_name][f_name][cls_name][ '_title'] = cls_title if cls_obj.__doc__ != None: self.products[p_name][f_name][cls_name][ '_desc'] = ' ' + cls_obj.__doc__ if cls_obj.__doc__ == None: self.products[p_name][f_name][cls_name][ '_desc'] = '' # Ordering order = Module(p_path + '/__init__.py') self.products[p_name]['_forder'] = L() for f in order.FEATURE_ORDER: if '.' in f: self.products[p_name]._forder << (f.lower().split('.')[0], f.lower().split('.')[1]) else: self.products[p_name]._forder << f.lower() # Dashboard self.products['dashboard'] = Dashboard() self.products.dashboard['_term'] = True self.products.dashboard['_name'] = 'dashboard' self.products.dashboard['_code'] = 'dashboard' self.products.dashboard['_url'] = '/dashboard/' self.products.dashboard['_title'] = 'Dashboard' self.products.dashboard['_desc'] = 'Cisco Webkit'
def __init__(self, *lines, **option): __View__.__init__(self, 'ctst_area', lines=L(*lines), opts=M(), labels=L(), series=L(), anima=False) for l in self.lines: self.series << L() self._link = self.__create_link__(option['link']) if 'link' in option else '' self._title = '<h3 class="cw-css-elem-title">%s</h3>' % option['title'] if 'title' in option else '' if 'height' in option: self.opts['height'] = str(option['height']) + 'px'
def __init__(self, **option): __View__.__init__(self, 'ctst_donut', opts=M(donutWidth='100%'), labels=L(), series=L()) self._link = self.__create_link__(option['link']) if 'link' in option else '' self._title = '<h3 class="cw-css-elem-title">%s</h3>' % option['title'] if 'title' in option else '' if 'height' in option: self.opts['height'] = str(option['height']) + 'px'
def __init__(self, *cols, **option): __View__.__init__(self, 'layout_row', cols=L()) for col in cols: if instof(col, Col): self.cols << col else: self.cols << Col(col)
def __init__(self, *rows, **option): __View__.__init__(self, 'layout', rows=L(*rows)) self._border = ' style="border: %dpx solid %s;"' % ( option['border'][0], option['border'][1]) if 'border' in option else ''
def __init__(self, submit, **kargs): __View__.__init__(self, 'form', **kargs) self._submit = submit self._order = L()
def __init__(self): __View__.__init__(self, 'hlist', item=L())