Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Load example network

        def load_example(filename):
    """
    Load example network
    """
    # No extension, see if filename is an included example Topology
    topology_dir =  resource_filename("AutoNetkit",
                os.path.join("lib", "examples", "topologies"))
    test_filename = os.path.join(topology_dir, "%s.graphml" % filename)
    if os.path.isfile(test_filename):
            LOG.info("Loading example topology %s " % filename)
            return ank.load_graphml(test_filename)
    else:
            example_files = glob.glob(topology_dir + os.sep + "*.graphml")
# Remove path
            example_files = (os.path.split(filename)[1] for filename in example_files)
# Remove extension
            example_files = (os.path.splitext(filename)[0] for filename in example_files)
            LOG.warn("Unable to find example topology %s" % filename)
            LOG.info("Valid example topologies are: " + ", ".join(example_files))
        


src/a/n/ank_le-HEAD/AutoNetkit/internet.py   ank_le(Download)
        if ext == "":
            #TODO: use try/except block here
            self.network.graph = ank.load_example(filename)
 
#TODO: allow url to be entered, eg from zoo, if so then download the file and proceed on as normal