Skip to content

Leading zeros in nodes names #14

@torkelsson

Description

@torkelsson

Another report from Magnus Ullner at Lunarc:

The second one is only a bug, if you want leading zeros in your node names.

           for sequence in parts[1].split(','):
               sequence = sequence.rstrip(']')
               #Bug 2: Node names with leading zeros get shortened to the integer value in node ranges
               if '-' in  sequence:
                   numbers = sequence.split('-')
                   #New line
                   numlength = len(numbers[0])

                   for i in range(int(numbers[0]),int(numbers[1])+1):
                       #nodes.append(parts[0] + str(i))
                       nodes.append(parts[0] + "{:0>{width}}".format(i,width=numlength))
               else:
                   nodes.append(parts[0] + sequence)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions