コード例 #1
0
ファイル: blocks_list.py プロジェクト: edf-hpc/pyslurm
                    else:
                        ddate = pyslurm.epoch2date(ddate)
                        print("\t{0:<17} : {1}".format(part_key, ddate))
                elif part_key == 'connection_type':
                    print("\t{0:<17} : {1}".format(part_key, pyslurm.get_connection_type(value[part_key])))
                elif part_key == 'state':
                    print("\t{0:<17} : {1}".format(part_key, value[part_key]))
                else:
                    print("\t{0:<17} : {1}".format(part_key, value[part_key]))

            print('{0:*^80}'.format(''))


if __name__ == "__main__":

    a = pyslurm.block()
    try:
        a.load()
        block_dict = a.get()
    except ValueError as e:
        print("Block query failed - {0}".format(e.args[0]))
    else:
        if len(block_dict) > 0:

            display(block_dict)
            print()
            print("Block IDs - {0}".format(a.ids()))
            print()

        else:
            print("No Blocks found !")
コード例 #2
0
ファイル: blocks_list.py プロジェクト: webbres/pyslurm
                        print("\t{0:<17} : {1}".format(part_key, ddate))
                elif part_key == 'connection_type':
                    print("\t{0:<17} : {1}".format(
                        part_key,
                        pyslurm.get_connection_type(value[part_key])))
                elif part_key == 'state':
                    print("\t{0:<17} : {1}".format(part_key, value[part_key]))
                else:
                    print("\t{0:<17} : {1}".format(part_key, value[part_key]))

            print('{0:*^80}'.format(''))


if __name__ == "__main__":

    a = pyslurm.block()
    try:
        a.load()
        block_dict = a.get()
    except ValueError as e:
        print("Block query failed - {0}".format(e.args[0]))
    else:
        if len(block_dict) > 0:

            display(block_dict)
            print()
            print("Block IDs - {0}".format(a.ids()))
            print()

        else:
            print("No Blocks found !")