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

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Reformat a 12-digit MAC address to contain
a dash between each 2 characters.

        def mac_with_dashes(mac):
    """
    Reformat a 12-digit MAC address to contain
    a dash between each 2 characters.
    """
    # From the itertools docs.
    return "-".join("%s%s" % i for i in izip_longest(fillvalue=None, *[iter(mac)]*2))
        


src/m/o/mozpool-4.1.5/mozpool/bmm/pxe.py   mozpool(Download)
    for a specific device.
    """
    mac_address = util.mac_with_dashes(mac_address)
    symlink_dir = os.path.join(config.get('paths', 'tftp_root'), "pxelinux.cfg")
    return os.path.join(symlink_dir, "01-" + mac_address)

src/m/o/mozpool-4.1.5/mozpool/test/fakedevices.py   mozpool(Download)
    def _get_second_stage(self):
        mac_address = util.mac_with_dashes(
                self.db.devices.get_mac_address(self.name))
        dir = os.path.join(config.get('paths', 'tftp_root'), "pxelinux.cfg")
        filename = os.path.join(dir, "01-" + mac_address)