Your IP : 216.73.216.213
B
D��]
� @ s� d Z dZdZdZdZddlZG dd� de�ZG d d
� d
e�ZG dd� de�Z G d
d� de�Z
dZdd� Ze�
dej�Zdd� ZdS )z"Convert to and from Roman numeralsz&Mark Pilgrim (f8dy@diveintopython.org)z1.4z
8 August 2001ag Copyright (c) 2001 Mark Pilgrim
This program is part of "Dive Into Python", a free Python tutorial for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
This program is free software; you can redistribute it and/or modify
it under the terms of the Python 2.1.1 license, available at
http://www.python.org/2.1.1/license.html
� Nc @ s e Zd ZdS )�
RomanErrorN)�__name__�
__module__�__qualname__� r r �E/opt/alt/python37/lib/python3.7/site-packages/docutils/utils/roman.pyr s r c @ s e Zd ZdS )�OutOfRangeErrorN)r r r r r r r r s r c @ s e Zd ZdS )�NotIntegerErrorN)r r r r r r r r s r c @ s e Zd ZdS )�InvalidRomanNumeralErrorN)r r r r r r r r
s r
)
)�Mi� )ZCMi� )�Di� )ZCDi� )�C�d )ZXC�Z )�L�2 )ZXL�( )�X�
)ZIX� )�V� )ZIV� )�I� c C sj d| k rdk sn t d��t| �| kr2td��d}x.tD ]&\}}x| |kr`||7 }| |8 } qFW q<W |S )z convert integer to Roman numeralr i� z%number out of range (must be 1..4999)zdecimals can not be converted� )r �intr �romanNumeralMap)�n�result�numeral�integerr r r �toRoman( s
r"