tryton 7.4.10__py3-none-any.whl → 7.6.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tryton might be problematic. Click here for more details.

Files changed (122) hide show
  1. tryton/__init__.py +1 -1
  2. tryton/bus.py +113 -69
  3. tryton/chat.py +179 -0
  4. tryton/client.py +7 -0
  5. tryton/common/__init__.py +15 -11
  6. tryton/common/button.py +1 -1
  7. tryton/common/cellrendererfloat.py +1 -1
  8. tryton/common/cellrenderertext.py +2 -2
  9. tryton/common/common.py +91 -19
  10. tryton/common/environment.py +2 -2
  11. tryton/common/number_entry.py +12 -6
  12. tryton/common/selection.py +1 -1
  13. tryton/data/locale/bg/LC_MESSAGES/tryton.mo +0 -0
  14. tryton/data/locale/bg/LC_MESSAGES/tryton.po +26 -16
  15. tryton/data/locale/ca/LC_MESSAGES/tryton.mo +0 -0
  16. tryton/data/locale/ca/LC_MESSAGES/tryton.po +29 -18
  17. tryton/data/locale/cs/LC_MESSAGES/tryton.mo +0 -0
  18. tryton/data/locale/cs/LC_MESSAGES/tryton.po +28 -16
  19. tryton/data/locale/de/LC_MESSAGES/tryton.mo +0 -0
  20. tryton/data/locale/de/LC_MESSAGES/tryton.po +27 -18
  21. tryton/data/locale/es/LC_MESSAGES/tryton.mo +0 -0
  22. tryton/data/locale/es/LC_MESSAGES/tryton.po +25 -16
  23. tryton/data/locale/es_419/LC_MESSAGES/tryton.mo +0 -0
  24. tryton/data/locale/es_419/LC_MESSAGES/tryton.po +26 -16
  25. tryton/data/locale/et/LC_MESSAGES/tryton.mo +0 -0
  26. tryton/data/locale/et/LC_MESSAGES/tryton.po +28 -18
  27. tryton/data/locale/fa/LC_MESSAGES/tryton.mo +0 -0
  28. tryton/data/locale/fa/LC_MESSAGES/tryton.po +28 -18
  29. tryton/data/locale/fi/LC_MESSAGES/tryton.mo +0 -0
  30. tryton/data/locale/fi/LC_MESSAGES/tryton.po +25 -16
  31. tryton/data/locale/fr/LC_MESSAGES/tryton.mo +0 -0
  32. tryton/data/locale/fr/LC_MESSAGES/tryton.po +25 -16
  33. tryton/data/locale/hu/LC_MESSAGES/tryton.mo +0 -0
  34. tryton/data/locale/hu/LC_MESSAGES/tryton.po +28 -18
  35. tryton/data/locale/id/LC_MESSAGES/tryton.mo +0 -0
  36. tryton/data/locale/id/LC_MESSAGES/tryton.po +23 -16
  37. tryton/data/locale/it/LC_MESSAGES/tryton.mo +0 -0
  38. tryton/data/locale/it/LC_MESSAGES/tryton.po +29 -18
  39. tryton/data/locale/ja_JP/LC_MESSAGES/tryton.mo +0 -0
  40. tryton/data/locale/lo/LC_MESSAGES/tryton.mo +0 -0
  41. tryton/data/locale/lo/LC_MESSAGES/tryton.po +26 -18
  42. tryton/data/locale/lt/LC_MESSAGES/tryton.mo +0 -0
  43. tryton/data/locale/lt/LC_MESSAGES/tryton.po +30 -18
  44. tryton/data/locale/nl/LC_MESSAGES/tryton.mo +0 -0
  45. tryton/data/locale/nl/LC_MESSAGES/tryton.po +25 -16
  46. tryton/data/locale/pl/LC_MESSAGES/tryton.mo +0 -0
  47. tryton/data/locale/pl/LC_MESSAGES/tryton.po +31 -18
  48. tryton/data/locale/pt/LC_MESSAGES/tryton.mo +0 -0
  49. tryton/data/locale/pt/LC_MESSAGES/tryton.po +148 -177
  50. tryton/data/locale/ro/LC_MESSAGES/tryton.mo +0 -0
  51. tryton/data/locale/ro/LC_MESSAGES/tryton.po +32 -19
  52. tryton/data/locale/ru/LC_MESSAGES/tryton.mo +0 -0
  53. tryton/data/locale/ru/LC_MESSAGES/tryton.po +28 -16
  54. tryton/data/locale/sl/LC_MESSAGES/tryton.mo +0 -0
  55. tryton/data/locale/sl/LC_MESSAGES/tryton.po +33 -18
  56. tryton/data/locale/tr/LC_MESSAGES/tryton.mo +0 -0
  57. tryton/data/locale/tr/LC_MESSAGES/tryton.po +25 -16
  58. tryton/data/locale/uk/LC_MESSAGES/tryton.mo +0 -0
  59. tryton/data/locale/uk/LC_MESSAGES/tryton.po +31 -18
  60. tryton/data/locale/zh_CN/LC_MESSAGES/tryton.mo +0 -0
  61. tryton/data/locale/zh_CN/LC_MESSAGES/tryton.po +27 -18
  62. tryton/data/pixmaps/tryton/tryton-chat.svg +1 -0
  63. tryton/data/pixmaps/tryton/tryton-note.svg +1 -4
  64. tryton/gui/window/attachment.py +2 -2
  65. tryton/gui/window/board.py +1 -1
  66. tryton/gui/window/form.py +57 -10
  67. tryton/gui/window/note.py +2 -2
  68. tryton/gui/window/tabcontent.py +8 -1
  69. tryton/gui/window/view_board/action.py +1 -1
  70. tryton/gui/window/view_form/model/field.py +34 -28
  71. tryton/gui/window/view_form/model/group.py +4 -4
  72. tryton/gui/window/view_form/model/record.py +19 -4
  73. tryton/gui/window/view_form/screen/screen.py +24 -4
  74. tryton/gui/window/view_form/view/calendar_gtk/calendar_.py +1 -1
  75. tryton/gui/window/view_form/view/calendar_gtk/toolbar.py +1 -1
  76. tryton/gui/window/view_form/view/form.py +2 -1
  77. tryton/gui/window/view_form/view/form_gtk/binary.py +3 -3
  78. tryton/gui/window/view_form/view/form_gtk/calendar_.py +4 -4
  79. tryton/gui/window/view_form/view/form_gtk/char.py +42 -5
  80. tryton/gui/window/view_form/view/form_gtk/checkbox.py +3 -3
  81. tryton/gui/window/view_form/view/form_gtk/dictionary.py +53 -15
  82. tryton/gui/window/view_form/view/form_gtk/float.py +3 -7
  83. tryton/gui/window/view_form/view/form_gtk/image.py +4 -4
  84. tryton/gui/window/view_form/view/form_gtk/integer.py +1 -1
  85. tryton/gui/window/view_form/view/form_gtk/many2many.py +3 -4
  86. tryton/gui/window/view_form/view/form_gtk/many2one.py +2 -2
  87. tryton/gui/window/view_form/view/form_gtk/multiselection.py +3 -3
  88. tryton/gui/window/view_form/view/form_gtk/one2many.py +11 -8
  89. tryton/gui/window/view_form/view/form_gtk/progressbar.py +2 -2
  90. tryton/gui/window/view_form/view/form_gtk/pyson.py +3 -3
  91. tryton/gui/window/view_form/view/form_gtk/reference.py +4 -4
  92. tryton/gui/window/view_form/view/form_gtk/richtextbox.py +5 -5
  93. tryton/gui/window/view_form/view/form_gtk/selection.py +3 -3
  94. tryton/gui/window/view_form/view/form_gtk/state_widget.py +8 -6
  95. tryton/gui/window/view_form/view/form_gtk/textbox.py +4 -4
  96. tryton/gui/window/view_form/view/form_gtk/timedelta.py +3 -3
  97. tryton/gui/window/view_form/view/form_gtk/url.py +2 -2
  98. tryton/gui/window/view_form/view/form_gtk/widget.py +1 -1
  99. tryton/gui/window/view_form/view/graph_gtk/bar.py +7 -7
  100. tryton/gui/window/view_form/view/graph_gtk/graph.py +2 -2
  101. tryton/gui/window/view_form/view/graph_gtk/line.py +5 -5
  102. tryton/gui/window/view_form/view/graph_gtk/pie.py +2 -2
  103. tryton/gui/window/view_form/view/list.py +107 -52
  104. tryton/gui/window/view_form/view/list_gtk/editabletree.py +2 -2
  105. tryton/gui/window/view_form/view/list_gtk/widget.py +22 -20
  106. tryton/gui/window/view_form/view/screen_container.py +13 -1
  107. tryton/gui/window/win_csv.py +2 -2
  108. tryton/gui/window/win_export.py +9 -7
  109. tryton/gui/window/win_form.py +74 -39
  110. tryton/gui/window/win_import.py +5 -6
  111. tryton/gui/window/wizard.py +11 -11
  112. tryton/jsonrpc.py +2 -2
  113. tryton/plugins/__init__.py +0 -1
  114. tryton/pyson.py +18 -18
  115. tryton/rpc.py +7 -5
  116. {tryton-7.4.10.dist-info → tryton-7.6.1.dist-info}/METADATA +5 -5
  117. {tryton-7.4.10.dist-info → tryton-7.6.1.dist-info}/RECORD +121 -120
  118. tryton/gui/window/view_form/view/list_gtk/generictreemodel.py +0 -426
  119. {tryton-7.4.10.data → tryton-7.6.1.data}/scripts/tryton +0 -0
  120. {tryton-7.4.10.dist-info → tryton-7.6.1.dist-info}/WHEEL +0 -0
  121. {tryton-7.4.10.dist-info → tryton-7.6.1.dist-info}/licenses/LICENSE +0 -0
  122. {tryton-7.4.10.dist-info → tryton-7.6.1.dist-info}/top_level.txt +0 -0
@@ -1,426 +0,0 @@
1
- # -*- Mode: Python; py-indent-offset: 4 -*-
2
- # generictreemodel - GenericTreeModel implementation for pygtk compatibility.
3
- # Copyright (C) 2013 Simon Feltman
4
- #
5
- # generictreemodel.py: GenericTreeModel implementation for pygtk compatibility
6
- #
7
- # This library is free software; you can redistribute it and/or
8
- # modify it under the terms of the GNU Lesser General Public
9
- # License as published by the Free Software Foundation; either
10
- # version 2.1 of the License, or (at your option) any later version.
11
- #
12
- # This library is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- # Lesser General Public License for more details.
16
- #
17
- # You should have received a copy of the GNU Lesser General Public
18
- # License along with this library; if not, see <http://www.gnu.org/licenses/>.
19
-
20
-
21
- # System
22
- import sys
23
- import random
24
- import collections
25
- import ctypes
26
- import platform
27
- import warnings
28
-
29
- # GObject
30
- import gi
31
- from gi.repository import GObject
32
- from gi.repository import Gtk
33
-
34
-
35
- class _CTreeIter(ctypes.Structure):
36
- _fields_ = [('stamp', ctypes.c_int),
37
- ('user_data', ctypes.c_void_p),
38
- ('user_data2', ctypes.c_void_p),
39
- ('user_data3', ctypes.c_void_p)]
40
-
41
- @classmethod
42
- def from_iter(cls, iter):
43
- offset = sys.getsizeof(object()) # size of PyObject_HEAD
44
- return ctypes.POINTER(cls).from_address(id(iter) + offset)
45
-
46
-
47
- if platform.python_implementation() == "PyPy":
48
- def _get_user_data_as_pyobject(iter):
49
- raise NotImplementedError("Not yet supported under PyPy")
50
- else:
51
- def _get_user_data_as_pyobject(iter):
52
- citer = _CTreeIter.from_iter(iter)
53
- return ctypes.cast(citer.contents.user_data, ctypes.py_object).value
54
-
55
-
56
- def handle_exception(default_return):
57
- """Returns a function which can act as a decorator for wrapping exceptions and
58
- returning "default_return" upon an exception being thrown.
59
-
60
- This is used to wrap Gtk.TreeModel "do_" method implementations so we can return
61
- a proper value from the override upon an exception occurring with client code
62
- implemented by the "on_" methods.
63
- """
64
- def decorator(func):
65
- def wrapped_func(*args, **kargs):
66
- try:
67
- return func(*args, **kargs)
68
- except:
69
- # Use excepthook directly to avoid any printing to the screen
70
- # if someone installed an except hook.
71
- sys.excepthook(*sys.exc_info())
72
- return default_return
73
- return wrapped_func
74
- return decorator
75
-
76
-
77
- class GenericTreeModel(GObject.GObject, Gtk.TreeModel):
78
- """A base implementation of a Gtk.TreeModel for python.
79
-
80
- The GenericTreeModel eases implementing the Gtk.TreeModel interface in Python.
81
- The class can be subclassed to provide a TreeModel implementation which works
82
- directly with Python objects instead of iterators.
83
-
84
- All of the on_* methods should be overridden by subclasses to provide the
85
- underlying implementation a way to access custom model data. For the purposes of
86
- this API, all custom model data supplied or handed back through the overridable
87
- API will use the argument names: node, parent, and child in regards to user data
88
- python objects.
89
-
90
- The create_tree_iter, set_user_data, invalidate_iters, iter_is_valid methods are
91
- available to help manage Gtk.TreeIter objects and their Python object references.
92
-
93
- GenericTreeModel manages a pool of user data nodes that have been used with iters.
94
- This pool stores a references to user data nodes as a dictionary value with the
95
- key being the integer id of the data. This id is what the Gtk.TreeIter objects
96
- use to reference data in the pool.
97
- References will be removed from the pool when the model is deleted or explicitly
98
- by using the optional "node" argument to the "row_deleted" method when notifying
99
- the model of row deletion.
100
- """
101
-
102
- leak_references = GObject.Property(default=True, type=bool,
103
- blurb="If True, strong references to user data attached to iters are "
104
- "stored in a dictionary pool (default). Otherwise the user data is "
105
- "stored as a raw pointer to a python object without a reference.")
106
-
107
- #
108
- # Methods
109
- #
110
- def __init__(self):
111
- """Initialize. Make sure to call this from derived classes if overridden."""
112
- warnings.warn("pygtkcompat is deprecated, see https://pygobject.gnome.org for migration instructions", gi.PyGIDeprecationWarning)
113
- super(GenericTreeModel, self).__init__()
114
- self.stamp = 0
115
-
116
- #: Dictionary of (id(user_data): user_data), used when leak-references=False
117
- self._held_refs = dict()
118
-
119
- # Set initial stamp
120
- self.invalidate_iters()
121
-
122
- def iter_depth_first(self):
123
- """Depth-first iteration of the entire TreeModel yielding the python nodes."""
124
- stack = collections.deque([None])
125
- while stack:
126
- it = stack.popleft()
127
- if it is not None:
128
- yield self.get_user_data(it)
129
- children = [self.iter_nth_child(it, i) for i in range(self.iter_n_children(it))]
130
- stack.extendleft(reversed(children))
131
-
132
- def invalidate_iter(self, iter):
133
- """Clear user data and its reference from the iter and this model."""
134
- iter.stamp = 0
135
- if iter.user_data:
136
- if iter.user_data in self._held_refs:
137
- del self._held_refs[iter.user_data]
138
- iter.user_data = None
139
-
140
- def invalidate_iters(self):
141
- """
142
- This method invalidates all TreeIter objects associated with this custom tree model
143
- and frees their locally pooled references.
144
- """
145
- self.stamp = random.randint(-2147483648, 2147483647)
146
- self._held_refs.clear()
147
-
148
- def iter_is_valid(self, iter):
149
- """
150
- :Returns:
151
- True if the gtk.TreeIter specified by iter is valid for the custom tree model.
152
- """
153
- return iter.stamp == self.stamp
154
-
155
- def get_user_data(self, iter):
156
- """Get the user_data associated with the given TreeIter.
157
-
158
- GenericTreeModel stores arbitrary Python objects mapped to instances of Gtk.TreeIter.
159
- This method allows to retrieve the Python object held by the given iterator.
160
- """
161
- if self.leak_references:
162
- return self._held_refs[iter.user_data]
163
- else:
164
- return _get_user_data_as_pyobject(iter)
165
-
166
- def set_user_data(self, iter, user_data):
167
- """Applies user_data and stamp to the given iter.
168
-
169
- If the models "leak_references" property is set, a reference to the
170
- user_data is stored with the model to ensure we don't run into bad
171
- memory problems with the TreeIter.
172
- """
173
- iter.user_data = id(user_data)
174
-
175
- if user_data is None:
176
- self.invalidate_iter(iter)
177
- else:
178
- iter.stamp = self.stamp
179
- if self.leak_references:
180
- self._held_refs[iter.user_data] = user_data
181
-
182
- def create_tree_iter(self, user_data):
183
- """Create a Gtk.TreeIter instance with the given user_data specific for this model.
184
-
185
- Use this method to create Gtk.TreeIter instance instead of directly calling
186
- Gtk.Treeiter(), this will ensure proper reference managment of wrapped used_data.
187
- """
188
- iter = Gtk.TreeIter()
189
- self.set_user_data(iter, user_data)
190
- return iter
191
-
192
- def _create_tree_iter(self, data):
193
- """Internal creation of a (bool, TreeIter) pair for returning directly
194
- back to the view interfacing with this model."""
195
- if data is None:
196
- return (False, None)
197
- else:
198
- it = self.create_tree_iter(data)
199
- return (True, it)
200
-
201
- def row_deleted(self, path, node=None):
202
- """Notify the model a row has been deleted.
203
-
204
- Use the node parameter to ensure the user_data reference associated
205
- with the path is properly freed by this model.
206
-
207
- :Parameters:
208
- path : Gtk.TreePath
209
- Path to the row that has been deleted.
210
- node : object
211
- Python object used as the node returned from "on_get_iter". This is
212
- optional but ensures the model will not leak references to this object.
213
- """
214
- super(GenericTreeModel, self).row_deleted(path)
215
- node_id = id(node)
216
- if node_id in self._held_refs:
217
- del self._held_refs[node_id]
218
-
219
- #
220
- # GtkTreeModel Interface Implementation
221
- #
222
- @handle_exception(0)
223
- def do_get_flags(self):
224
- """Internal method."""
225
- return self.on_get_flags()
226
-
227
- @handle_exception(0)
228
- def do_get_n_columns(self):
229
- """Internal method."""
230
- return self.on_get_n_columns()
231
-
232
- @handle_exception(GObject.TYPE_INVALID)
233
- def do_get_column_type(self, index):
234
- """Internal method."""
235
- return self.on_get_column_type(index)
236
-
237
- @handle_exception((False, None))
238
- def do_get_iter(self, path):
239
- """Internal method."""
240
- return self._create_tree_iter(self.on_get_iter(path))
241
-
242
- @handle_exception(False)
243
- def do_iter_next(self, iter):
244
- """Internal method."""
245
- if iter is None:
246
- next_data = self.on_iter_next(None)
247
- else:
248
- next_data = self.on_iter_next(self.get_user_data(iter))
249
-
250
- self.set_user_data(iter, next_data)
251
- return next_data is not None
252
-
253
- @handle_exception(None)
254
- def do_get_path(self, iter):
255
- """Internal method."""
256
- path = self.on_get_path(self.get_user_data(iter))
257
- if path is None:
258
- return None
259
- else:
260
- return Gtk.TreePath(path)
261
-
262
- @handle_exception(None)
263
- def do_get_value(self, iter, column):
264
- """Internal method."""
265
- return self.on_get_value(self.get_user_data(iter), column)
266
-
267
- @handle_exception((False, None))
268
- def do_iter_children(self, parent):
269
- """Internal method."""
270
- data = self.get_user_data(parent) if parent else None
271
- return self._create_tree_iter(self.on_iter_children(data))
272
-
273
- @handle_exception(False)
274
- def do_iter_has_child(self, parent):
275
- """Internal method."""
276
- return self.on_iter_has_child(self.get_user_data(parent))
277
-
278
- @handle_exception(0)
279
- def do_iter_n_children(self, iter):
280
- """Internal method."""
281
- if iter is None:
282
- return self.on_iter_n_children(None)
283
- return self.on_iter_n_children(self.get_user_data(iter))
284
-
285
- @handle_exception((False, None))
286
- def do_iter_nth_child(self, parent, n):
287
- """Internal method."""
288
- if parent is None:
289
- data = self.on_iter_nth_child(None, n)
290
- else:
291
- data = self.on_iter_nth_child(self.get_user_data(parent), n)
292
- return self._create_tree_iter(data)
293
-
294
- @handle_exception((False, None))
295
- def do_iter_parent(self, child):
296
- """Internal method."""
297
- return self._create_tree_iter(self.on_iter_parent(self.get_user_data(child)))
298
-
299
- @handle_exception(None)
300
- def do_ref_node(self, iter):
301
- self.on_ref_node(self.get_user_data(iter))
302
-
303
- @handle_exception(None)
304
- def do_unref_node(self, iter):
305
- self.on_unref_node(self.get_user_data(iter))
306
-
307
- #
308
- # Python Subclass Overridables
309
- #
310
- def on_get_flags(self):
311
- """Overridable.
312
-
313
- :Returns Gtk.TreeModelFlags:
314
- The flags for this model. See: Gtk.TreeModelFlags
315
- """
316
- raise NotImplementedError
317
-
318
- def on_get_n_columns(self):
319
- """Overridable.
320
-
321
- :Returns:
322
- The number of columns for this model.
323
- """
324
- raise NotImplementedError
325
-
326
- def on_get_column_type(self, index):
327
- """Overridable.
328
-
329
- :Returns:
330
- The column type for the given index.
331
- """
332
- raise NotImplementedError
333
-
334
- def on_get_iter(self, path):
335
- """Overridable.
336
-
337
- :Returns:
338
- A python object (node) for the given TreePath.
339
- """
340
- raise NotImplementedError
341
-
342
- def on_iter_next(self, node):
343
- """Overridable.
344
-
345
- :Parameters:
346
- node : object
347
- Node at current level.
348
-
349
- :Returns:
350
- A python object (node) following the given node at the current level.
351
- """
352
- raise NotImplementedError
353
-
354
- def on_get_path(self, node):
355
- """Overridable.
356
-
357
- :Returns:
358
- A TreePath for the given node.
359
- """
360
- raise NotImplementedError
361
-
362
- def on_get_value(self, node, column):
363
- """Overridable.
364
-
365
- :Parameters:
366
- node : object
367
- column : int
368
- Column index to get the value from.
369
-
370
- :Returns:
371
- The value of the column for the given node."""
372
- raise NotImplementedError
373
-
374
- def on_iter_children(self, parent):
375
- """Overridable.
376
-
377
- :Returns:
378
- The first child of parent or None if parent has no children.
379
- If parent is None, return the first node of the model.
380
- """
381
- raise NotImplementedError
382
-
383
- def on_iter_has_child(self, node):
384
- """Overridable.
385
-
386
- :Returns:
387
- True if the given node has children.
388
- """
389
- raise NotImplementedError
390
-
391
- def on_iter_n_children(self, node):
392
- """Overridable.
393
-
394
- :Returns:
395
- The number of children for the given node. If node is None,
396
- return the number of top level nodes.
397
- """
398
- raise NotImplementedError
399
-
400
- def on_iter_nth_child(self, parent, n):
401
- """Overridable.
402
-
403
- :Parameters:
404
- parent : object
405
- n : int
406
- Index of child within parent.
407
-
408
- :Returns:
409
- The child for the given parent index starting at 0. If parent None,
410
- return the top level node corresponding to "n".
411
- If "n" is larger then available nodes, return None.
412
- """
413
- raise NotImplementedError
414
-
415
- def on_iter_parent(self, child):
416
- """Overridable.
417
-
418
- :Returns:
419
- The parent node of child or None if child is a top level node."""
420
- raise NotImplementedError
421
-
422
- def on_ref_node(self, node):
423
- pass
424
-
425
- def on_unref_node(self, node):
426
- pass
File without changes