def change_document(part, page): fragment = '' item = 'index.xaml' loc = 'docs/' if part > 0: # page can be -1 if page > 0: item = 'item%s.xaml' % page fragment = 'part%s-page%s' % (part, page) else: fragment = 'part%s' % part loc += 'part%s/' % part path = loc + item if path in _xaml_cache: document = _xaml_cache[path] else: document = load_document(path, page, console_textbox) _xaml_cache[path] = document if page < 1: add_stackpanel(document, get_list(loc + 'list.txt')) HtmlPage.Window.CurrentBookmark = fragment documentContainer.Content = document document.Width = documentContainer.Width - 30 @always_invoke def scroll_and_focus(): documentContainer.ScrollToVerticalOffset(0) focus_text_box() scroll_and_focus() change_title()
def change_document(part, page): fragment = "" item = "index.xaml" loc = "docs/" if part > 0: # page can be -1 if page > 0: item = "item%s.xaml" % page fragment = "part%s-page%s" % (part, page) else: fragment = "part%s" % part loc += "part%s/" % part path = loc + item if path in _xaml_cache: document = _xaml_cache[path] else: document = load_document(path, page, console_textbox) _xaml_cache[path] = document if page < 1: add_stackpanel(document, get_list(loc + "list.txt")) HtmlPage.Window.CurrentBookmark = fragment documentContainer.Content = document document.Width = documentContainer.Width - 30 @always_invoke def scroll_and_focus(): documentContainer.ScrollToVerticalOffset(0) focus_text_box() scroll_and_focus() change_title()
def download(model_list_path, output_dir, force): model_list = load_document(model_list_path) if model_list is None: sys.exit(1) validate_schema(model_list) target_root = os.path.join(output_dir, "models") create_directory(target_root, False) for model in model_list: download_and_convert_model(target_root, model, force)
def create_db(system_password): "Create the database and load the designs and the 'system' account." site = configuration.site server = couchdb.Server(site.COUCHDB_SERVER) db = server.create(site.COUCHDB_DATABASE) utils.load_designs(db) doc = utils.load_document(db, 'account', identifier='system', role='admin', password=utils.get_hexdigest(system_password), fullname='System', initials='SYS') utils.load_document(db, 'log', docid=doc['_id'], action='created', account='system') utils.load_document(db, 'system', identifier='settings', project_steps=[ "contract", "QC incoming samples", "queued", "library prep", "qPCR", "SOLiD WFA", "454 titration", "amplification", "sequencing", "data transfer", "data analysis", "data delivery", "invoice", "payment" ], project_references=[ "hg19", "other", "unknown" ], project_platforms=[ "Illumina Hiseq", "SOLiD", "GS-FLX" ], project_applications=[ "total RNA", "small RNA", "MP de novo", "MP metagenomics", "custom sequence capture", "metagenomics", "exome sequencing", "de novo", "WGS", "ChipSeq", "epigenomics", "finished library" ], project_lab_protocols=[ "DNA standard", "total RNA", "small RNA", "mate pair", "sequence capture" ], project_sequencing_setups=[ "Illumina PE 2*100", "Illumina PE 2*50", "Illumina SR 1*100", "Illumina SR 1*50", "SOLiD 2*75", "SOLiD 1*50", "SOLiD 1*35", "SOLiD 75+35", "SOLiD 50+35", "454 400", "454 850" ], sample_steps=[ "arrival", "QC incoming", "library prep", "QC library prep", "qPCR", "sequencing", "QC sequencing" ], sample_types=[ "DNA", "cDNA", "total RNA", "mRNA", "small RNA", "metagenomics", "ChipSeq", "epigenetics", "library prep", "captured library", "other" ], workset_steps=[ "designed", "sequencing", "clustering" ], workset_types=[ "collection", "plate", "lane", "flowcell" ] )