Translate comments from Italian to English

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/2/head
Michele Calgaro 5 years ago
parent ea226c5b5d
commit 432a52092b
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -6,7 +6,7 @@
# # # #
#--Maurizio Paolini-Daniele Zambelli-----------------------------2005---# #--Maurizio Paolini-Daniele Zambelli-----------------------------2005---#
# #
# (licenza GPL) # (GPL license)
version="0.2.11" version="0.2.11"
@ -112,18 +112,18 @@ def kig_relpoint(obj, displ):
##### #####
##### #####
# Classe KigDocument # Class KigDocument
##### #####
class KigDocument(object): class KigDocument(object):
""" Classe che produce il documento kig. """ This class creates the kig document.
genealogia: hierarchy:
KigDocument <- object KigDocument <- object
attributi di classe: class attributes:
attributi: attributes:
axes axes
grid grid
outfilename outfilename
@ -140,7 +140,7 @@ class KigDocument(object):
shown shown
color color
metodi: methods:
viewappend viewappend
hierarchyappend hierarchyappend
setcallkig setcallkig
@ -234,24 +234,24 @@ class KigDocument(object):
def setinternal(self, v): self.internal=v def setinternal(self, v): self.internal=v
##### #####
# Classe KigDOP # Class KigDOP
##### #####
#class KigDOP(KigOut): #class KigDOP(KigOut):
class KigDOP(object): class KigDOP(object):
"""Classe da cui deriva ogni elemento che ha un id: Data, Object, Property. """Base class for all object containing an id: Data, Object, Property.
genealogia: hierarchy:
kigDOP <- object kigDOP <- object
attributo di classe: class attributes:
id-counter id-counter
attributi: attributes:
id id
type type
metodi: methods:
getid getid
str_hierarchy str_hierarchy
""" """
@ -269,20 +269,20 @@ class KigDOP(object):
def str_hierarchy(self): pass def str_hierarchy(self): pass
##### #####
# Classe KigView # Class KigView
##### #####
#class KigView(KigOut): #class KigView(KigOut):
class KigView(object): class KigView(object):
""" Classe con i dati di visualizzazione """ Class containing visualization data
genealogia: hierarchy:
KigView <- object KigView <- object
attributi di classe: class attributes:
_kd _kd
attributi: attributes:
shown shown
width width
style style
@ -290,7 +290,7 @@ class KigView(object):
name name
pointstyle pointstyle
metodi: methods:
str_view str_view
show show
hide hide
@ -308,9 +308,9 @@ class KigView(object):
KigView._kd.viewappend(self) KigView._kd.viewappend(self)
def str_view(self): def str_view(self):
"""Produce la stringa che viene scritta sotto <View>. """Creates the string written in <View>.
esempio: Example:
<Draw width="-1" point-style="Round" namecalcer="none" <Draw width="-1" point-style="Round" namecalcer="none"
style="SolidLine" shown=None color="#0000ff" object="3" /> style="SolidLine" shown=None color="#0000ff" object="3" />
""" """
@ -321,19 +321,19 @@ style="SolidLine" shown=None color="#0000ff" object="3" />
self.linestyle, self.shown, self.color, self.object.getid()) self.linestyle, self.shown, self.color, self.object.getid())
##### #####
# Classe Data # Class Data
##### #####
class Data(KigDOP): class Data(KigDOP):
""" Classe da cui deriva ogni elemento Data """ Base class for all Data element
genealogia: hierarchy:
Data <- KigDOP <- object Data <- KigDOP <- object
attributi: attributes:
val val
metodi: methods:
str_hierarchy str_hierarchy
""" """
def __init__(self, type, val): def __init__(self, type, val):
@ -341,32 +341,32 @@ class Data(KigDOP):
KigDOP.__init__(self, type) KigDOP.__init__(self, type)
def str_hierarchy(self): def str_hierarchy(self):
"""Produce la stringa che viene scritta sotto <Data>. """Creates the <Data> string.
esempio: Example:
<Data type="double" id="170" >0.1</Data> <Data type="double" id="170" >0.1</Data>
""" """
return ' <Data type="%s" id="%s" >%s</Data>\n' % \ return ' <Data type="%s" id="%s" >%s</Data>\n' % \
(self._type, self.getid(), self.val) (self._type, self.getid(), self.val)
##### #####
# Classe PropObj # Class PropObj
##### #####
class PropObj(KigDOP): class PropObj(KigDOP):
""" Classe da cui deriva ogni elemento visibile """ Base class for all visible object
genealogia: hierarchy:
PropObj <- KigDOP <- object PropObj <- KigDOP <- object
attributi di classe: class attributes:
attributi: attributes:
prop prop
objvec objvec
view view
metodi: methods:
str_hierarchy str_hierarchy
showname(self, n) showname(self, n)
show(self) show(self)
@ -393,8 +393,7 @@ class PropObj(KigDOP):
if internal: if internal:
self.view = None self.view = None
else: else:
# Qui si assume che, se viene dato un nome ad un oggetto, # Here we assume that if an object is named, the name should also be shown.
# si voglia anche visualizzare questo nome
if name: n_id=self.showname(name, shown, width, pointstyle, linestyle, if name: n_id=self.showname(name, shown, width, pointstyle, linestyle,
color) color)
else: n_id=None else: n_id=None
@ -402,14 +401,14 @@ class PropObj(KigDOP):
color) color)
def str_hierarchy(self): def str_hierarchy(self):
"""Produce la stringa che viene scritta sotto <Data>. """Creates the <Data> string.
esempio: Example:
<Property which="mid-point" id="170" > <Property which="mid-point" id="170" >
<Parent id="..." /> <Parent id="..." />
</Property> </Property>
oppure: or:
<Object type="ConstrainedPoint" id="14" > <Object type="ConstrainedPoint" id="14" >
<Parent id="13" /> <Parent id="13" />
<Parent id="10" /> <Parent id="10" />
@ -448,13 +447,13 @@ class PropObj(KigDOP):
def setshown(self, s): self.view.shown=s def setshown(self, s): self.view.shown=s
##### #####
# Classe Property # Class Property
##### #####
class Property(PropObj): class Property(PropObj):
""" Classe da cui deriva ogni elemento Property """ Base class for all Property elements
genealogia: hierarchy:
Property <- PropObj <- KigDOP <- object Property <- PropObj <- KigDOP <- object
""" """
def __init__(self, type, parent, shown, name, internal, def __init__(self, type, parent, shown, name, internal,
@ -464,13 +463,13 @@ class Property(PropObj):
# print shown # print shown
##### #####
# Classe Object # Class Object
##### #####
class Object(PropObj): class Object(PropObj):
""" Classe da cui deriva ogni elemento Oggetto """ Base class for all Object elements
genealogia: hierarchy:
Object <- PropObj <- KigDOP <- object Object <- PropObj <- KigDOP <- object
""" """
@ -509,7 +508,7 @@ for d in data:
##### #####
# Objects # Objects
##### #####
"""Da aggiungere: """To be added:
("ConvexHall", "ConvexHall", "polygon,", "(polygon,),"), ("ConvexHall", "ConvexHall", "polygon,", "(polygon,),"),
("EllipseByFocusFocusPoint", "EllipseBFFP", "p1, p2, p3,", "(p1, p2, p3,),"), ("EllipseByFocusFocusPoint", "EllipseBFFP", "p1, p2, p3,", "(p1, p2, p3,),"),
("HyperbolaByFocusFocusPoint", "HyperbolaBFFP", "p1, p2, p3,", "(p1, p2, p3,),"), ("HyperbolaByFocusFocusPoint", "HyperbolaBFFP", "p1, p2, p3,", "(p1, p2, p3,),"),
@ -547,28 +546,27 @@ objects=(\
##### #####
("LineLineIntersection", "LineLineIntersection", "l1, l2,", "(l1, l2),"), ("LineLineIntersection", "LineLineIntersection", "l1, l2,", "(l1, l2),"),
##### #####
# Classe CircleCircleIntersection e ConicLineIntersection # Class CircleCircleIntersection and ConicLineIntersection
# l'intero "which" puo' assumere i valori 1 o -1 per indicare quale # the value of the "which" integer (1 or -1) indicates which of the two
# delle due intersezioni si desidera ottenere # intersections we want to get.
# si potrebbe mettere un controllo...
##### #####
("CircleCircleIntersection", "CircleCircleIntersection", ("CircleCircleIntersection", "CircleCircleIntersection",
"c1, c2, witch,", "(c1, c2, Int(witch),),"), "c1, c2, witch,", "(c1, c2, Int(witch),),"),
("ConicLineIntersection", "ConicLineIntersection", ("ConicLineIntersection", "ConicLineIntersection",
"conic, line, witch,", "(conic, line, Int(witch),),"), "conic, line, witch,", "(conic, line, Int(witch),),"),
###### Classe Triangle ###### Class Triangle
("Triangle", "TriangleB3P", "p1, p2, p3,", "(p1, p2, p3),"), ("Triangle", "TriangleB3P", "p1, p2, p3,", "(p1, p2, p3),"),
###### Classe Polygon (the only argument is a points vect) ###### Class Polygon (the only argument is a points vect)
("Polygon", "PolygonBNP", "pvec,", "pvec,"), ("Polygon", "PolygonBNP", "pvec,", "pvec,"),
###### Classe PolygonBCV ###### Class PolygonBCV
# Poligono regolare dati il centro e un vertice; il terzo argomento # Regular polygon given the center and a vertex; the third parameter
# e' un intero contenente il numero di lati # is an integer containing the number of sides.
("PolygonBCV", "PoligonBCV", ("PolygonBCV", "PoligonBCV",
"center, vertex, n,", "(center, vertex, Int(n)),"), "center, vertex, n,", "(center, vertex, Int(n)),"),
##### Classe PolygonVertex (poligono, intero >= 0) ##### Class PolygonVertex (polygon, integer >= 0)
("PolygonVertex", "PolygonVertex", ("PolygonVertex", "PolygonVertex",
"polygon, i,", "(polygon, Int(i)),"), "polygon, i,", "(polygon, Int(i)),"),
##### Classe PolygonSide (poligono, intero >= 0) ##### Class PolygonSide (polygon, integer >= 0)
("PolygonSide", "PolygonSide", ("PolygonSide", "PolygonSide",
"polygon, i,", "(polygon, Int(i)),"), "polygon, i,", "(polygon, Int(i)),"),
###### vector, angle,... ###### vector, angle,...
@ -677,7 +675,7 @@ for p in property:
##### #####
# Start of properties definitions as Object's metod # Start of properties definitions as Object's metod
##### #####
# da sistemare! # fixme!
points =(Point, ConstrainedPoint, RelativePoint, PolygonVertex) points =(Point, ConstrainedPoint, RelativePoint, PolygonVertex)
lines=(Segment, Ray, Vector, InvertLine) lines=(Segment, Ray, Vector, InvertLine)
segments=(Segment, Vector, PolygonSide, InvertSegment) segments=(Segment, Vector, PolygonSide, InvertSegment)
@ -774,9 +772,9 @@ def prog():
elif _opt in ("-o", "--output"): elif _opt in ("-o", "--output"):
_outfilename=_arg _outfilename=_arg
_of=True _of=True
_callKig=False # se c'è il file di output, non viene chiamato Kig _callKig=False # if the output filename is provided, don't call Kig
if len(_args)==0: if len(_args)==0:
_infilename=raw_input("Nome del file di input: ") _infilename=raw_input("Input filename: ")
if not _infilename: if not _infilename:
print "No Input filename" print "No Input filename"
usage(2) usage(2)
@ -803,7 +801,7 @@ def prog():
execfile(_infilename, globals()) execfile(_infilename, globals())
except: except:
print >> sys.stderr, 'syntax error in', _infilename print >> sys.stderr, 'syntax error in', _infilename
_info = sys.exc_info() # vorrei stampare il traceback... _info = sys.exc_info() # print the traceback
traceback.print_exc() traceback.print_exc()
sys.exit(3) sys.exit(3)
kigdocument.close() kigdocument.close()

Loading…
Cancel
Save