/usr/lib/python2.7/dist-packages/tryton/gui/window/view_form/view/__init__.py is in tryton-client 3.8.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from tryton.common import node_attributes
class View(object):
view_type = None
widget = None
view_id = None
modified = None
editable = None
children_field = None
def __init__(self, screen, xml):
self.screen = screen
self.fields = {}
self.attributes = node_attributes(xml)
screen.set_on_write(self.attributes.get('on_write'))
def set_value(self):
raise NotImplementedError
def get_fields(self):
raise NotImplementedError
@property
def selected_records(self):
return []
def get_buttons(self):
raise NotImplementedError
@property
def title(self):
return self.attributes.get('string', '')
@staticmethod
def parse(screen, xml, children_field):
from .list import ViewTree
from .form import ViewForm
from .graph import ViewGraph
from .calendar_ import ViewCalendar
root, = xml.childNodes
tagname = root.tagName
if tagname == 'tree':
return ViewTree(screen, root, children_field)
elif tagname == 'form':
return ViewForm(screen, root)
elif tagname == 'graph':
return ViewGraph(screen, root)
elif tagname == 'calendar':
return ViewCalendar(screen, root)
|