* src/Utils.py (roman, pt2cm, cm2pt): Remove functions.

* src/ReportUtils.py (roman): Add function.
* src/docgen/OpenOfficeDoc.py (pt2cm): Remove function.
* src/docgen/PSDrawDoc.py (pt2cm): Remove function.
* src/plugins/AncestorChart2.py: Use ReportUtils.
* src/plugins/AncestorChart.py: Use ReportUtils.
* src/plugins/DesGraph.py: Use ReportUtils.
* src/plugins/FanChart.py: Use ReportUtils.
* src/plugins/StatisticsChart.py: Use ReportUtils.
* src/plugins/TimeLine.py: Use ReportUtils.


svn: r3937
This commit is contained in:
Alex Roitman
2005-01-19 04:47:36 +00:00
parent 503deaf553
commit 660028889a
11 changed files with 69 additions and 77 deletions

View File

@ -414,37 +414,6 @@ def search_for(name):
return 1
return 0
#-------------------------------------------------------------------------
#
# Roman numbers
#
#-------------------------------------------------------------------------
def roman(num):
""" Integer to Roman numeral converter for 0 < num < 4000 """
if type(num) != type(0):
return "?"
if not 0 < num < 4000:
return "?"
vals = (1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1)
nums = ( 'M','CM', 'D','CD', 'C','XC', 'L','XL', 'X','IX', 'V','IV', 'I')
retval = ""
for i in range(len(vals)):
amount = int(num / vals[i])
retval += nums[i] * amount
num -= vals[i] * amount
return retval
#-------------------------------------------------------------------------
#
# Convert points to cm and back
#
#-------------------------------------------------------------------------
def pt2cm(pt):
return (float(pt)/28.3465)
def cm2pt(cm):
return (float(cm)/2.54)*72
#-------------------------------------------------------------------------
#
# Change label apperance