An error occurred fetching the project authors.
- 14 Jan, 2025 1 commit
-
-
Kazuhiko Shiozaki authored
-
- 15 Oct, 2024 1 commit
-
-
Jérome Perrin authored
* Zope API changes: + publish(): - stdin is now BytesIO rather than StringIO. - Returned value of a script is passed to str() in python2, not in python3 anymore. + HTTPResponse `body` property is now bytes(). + OFS.Image.File file parameter is bytes(). + zope.interface implements() is now @implementer decorator. + Python standard logging module recommended instead of zLOG. * Python3 API changes: + builtin reduce() was removed. + urlnorm is now available. + Use BytesIO rather than StringIO to follow py3 API. + hmac.new() requires digestmod argument from Python 3.8. + Use six.moves library to handle moved objects from py2 to py3. + `modernize -f xrange_six` then slightly adjusted manually to just use range where it does not make a significant difference (for example in test). + base64.b64encode() now expects bytes(). + UserDict() interface changed: - New parameter in update() and pop(). - `failobj` setdefault parameter renamed to `default`. + ensure_list() on dict.{values,items}() and list(dict) for dict.keys() when we really need a list and not an iterable (Python3). + Make dict iteration works on both version of Python. - Use six.iter{items,values,keys}(). - has_key() has been removed. - Make sure that dict.{items,values,keys}() returns a real list when modified (ensure_list()). + Comparisons between int and NoneType raises TypeError. + BTrees key must be str() not int() (_getOb()). + No more unbound methods in python3 so use six.get_unbound_function(). + Exceptions: - No longer behave as sequences. Using `args` attribute instead. - When an exception has been assigned using `as target`, it is cleared at the end of the except clause. + file: py2 was returning `str` upon reading, now it returns text strings. Also, opening mode is text strings by default. + Data strings are bytes(). - Replace str() by bytes(). + iterators no longer have next() method, instead there is next() builtin. + New ConnectionError exception so rename existing one to not clash. + Integer division is now with //. + __nonzero__ is now __bool__. + apply() does not exist anymore. + Deprecated threading.Thread isAlive() has been removed. + im_func replaced by __func__. + Use six.with_metaclass() to define metaclass in a cross-compatible way with py2 and py3. + Only test method can be marked as expectedFailure(), not assert statement anymore. + os.path.walk() removed. + HTMLParser never fails: no strict mode nor HTMLParseError anymore (Python #15114). + Unpickler.find_global() is now Unpickler.find_class(). Co-Authored-by:
Kazuhiko SHIOZAKI <kazuhiko@nexedi.com> Co-Authored-by:
Arnaud Fontaine <arnaud.fontaine@nexedi.com> Co-Authored-by:
Carlos Ramos Carreño <carlos.ramos@nexedi.com> Co-Authored-by:
Emmeline Vouriot <emmeline.vouriot@nexedi.com>
-
- 10 Sep, 2024 1 commit
-
-
Kazuhiko Shiozaki authored
so that we can identify recently deleted objects, that are important to resynchronise catalog and ZODB in case of a catastrophe.
-
- 19 Mar, 2024 1 commit
-
-
Jérome Perrin authored
constructs like `portal_catalog(title=d.keys())` were allowed on python2, we can allow them on python3 as well.
-
- 05 Mar, 2024 1 commit
-
-
Jérome Perrin authored
When searching for something like for example "A AND B", make sure that the AND complex query contains query for ["A", "B"], not ["B", "A"]. This is probably always equivalent in generated SQL, but this makes testing easier. Revealed by testSQLCatalog.TestSQLCatalog with PYTHONHASHSEED 279 on py2
-
- 21 Feb, 2024 1 commit
-
-
Jérome Perrin authored
We were importing from an old alias in App.class_init, but this module has been removed from Zope5
-
- 08 Mar, 2023 1 commit
-
-
Kazuhiko Shiozaki authored
-
- 03 Mar, 2023 2 commits
-
-
Kazuhiko Shiozaki authored
-
Jérome Perrin authored
This reverts commit eaae74a0. On Zope4 branch we are ready to use __code__
-
- 28 Nov, 2022 1 commit
-
-
Julien Muchembled authored
This fixes things like: portal_catalog(source_reference={'query':'foo OR bar', 'key':'KeywordKey'}) or: portal_catalog(query=AutoQuery(source_reference='foo OR bar', key='KeywordKey')) So we get: (`...`.`reference` LIKE '%foo%' OR `...`.`reference` LIKE '%bar%') instead of: `...`.`reference` IN ('{\'query\': \'foo\', \'key\': \'KeywordKey\'}', '{\'query\': \'bar\', \'key\': \'KeywordKey\'}') Also, remove default values as it makes it easy for caller to leave arguments out by mistake. Also, use positional arguments as they are faster than named arguments. See merge request nexedi/erp5!1698
-
- 28 Sep, 2022 1 commit
-
-
Kazuhiko Shiozaki authored
-
- 24 May, 2022 1 commit
-
-
Jérome Perrin authored
On Zope2, python scripts do not have __code__, they only have func_code (and same for __defauls__/func_defaults). We tried to backport the support of __code__ from Zope4 as a Zope2 patch - it was SlapOS patch 4fa33dfc6 (erp5: py3: `func_{code,defaults}` was replaced in Python3 by `__{code,defaults}__`., 2022-04-25), but this patch was incomplete. We tried to backport more, but then realized that we don't need to use __code__ on ERP5 master yet, because ERP5 master branch is still supporting Zope2 only. This patch revert a small part of a17bb910 (py2/py3: Make Products code compatible with both python2 and python3., 2022-04-13), the part where we use f.__code__ where f might be a python script. For now, we'll apply this patch only on the Zope4 branch. A few places where f.func_code was used and f was a for sure not a python script but a simple class method or function are kept here, as __code__ support is missing only on in ZODB scripts.
-
- 04 May, 2022 1 commit
-
-
Arnaud Fontaine authored
Done through various 2to3 fixers (zope.fixers, modernize, future) and manual changes. This is a single commit so that we have a clearer picture of how code converted with my2to3 should look like. Except straightforward @implementer decorator 2to3 fixer, only product/ folder was considered as the goal was to be able to create an ERP5Site. * Use @implementer decorator introduced in zope.interface 3.6.0 (2010): The implements syntax used under Python 2.X does not work under 3.X, since it depends on how metaclasses are implemented and this has changed. Instead it now supports a decorator syntax (also under Python 2.X). Applied thanks to 2to3 `zope.fixers` package. * Use `six.moves` rather than `future` install_aliases() feature because the latter use unicode_literals and "wraps" module aliases so that unicode() are returned for text rather than str() (Python2 standard library). This notably breaks BusinessTemplate code which uses urllib quote() for filesystem paths... * No more unbound methods in python3 so use six.get_unbound_function(). * dict.(iteritems,iterkeys,itervalues)() => six.\1(dict) thanks to `dict_six` 2to3 fixer from `modernize`: $ python-modernize -w -f dict_six product/ * Manually make sure that dict.{items,values,keys}() returns a real list when it is latter modified rather than a dict_{items,values,keys} (ensure_list()). By default, 2to3 blindly does list(dict.{items,values,keys}()) which is not acceptable from performances point of view. With my2to3, this will be possible to handle such case automatically. * Replace cStringIO.StringIO() by six.moves.cStringIO() (a module alias for cStringIO.StringIO() on py2 and io.StringIO() on py3). * Use six.text_type which maps to unicode() on py2 and str() on py3. This also makes a clearer difference between text and binary strings. * Replace map()/filter() with lambda function by list comprehension (this has the benefit to avoid casting to list for py3 as it returns iterators).
-
- 29 Apr, 2021 1 commit
-
-
Aurel authored
-
- 27 Nov, 2019 1 commit
-
-
Vincent Pelletier authored
Add support for "like" auto-detection and use as default comparison operator. Allows mimicking KeywordKey and DefaultKey with 2 parameters, in addition to already-supported simple SearchKey.
-
- 07 Nov, 2019 5 commits
-
-
Vincent Pelletier authored
To avoid duplicating _processSearchValue.
-
Vincent Pelletier authored
Scriptable keys are already handled by other branches below. If one wants to provide a string or dict value to a scriptable key, they need to wrap it into another type to disable catalog processing of these values.
-
Vincent Pelletier authored
-
Vincent Pelletier authored
Also, add a missing ignore_unknown_columns parameter.
-
Vincent Pelletier authored
These are only accessed within methods which are not reachable from this SearckKey type, so this was essentially dead code.
-
- 06 Nov, 2019 1 commit
-
-
Vincent Pelletier authored
-
- 13 Sep, 2019 1 commit
-
-
Kazuhiko Shiozaki authored
Vincent Pelletier: - Ignore TimerService-originated publication requests. - Add copyright headers. - Disable timeout by default. - Give a meaning to requested negative deadlines. - Docstrings. - Assorted simplifications.
-
- 10 Sep, 2019 1 commit
-
-
Jérome Perrin authored
During indexation we don't apply security checks, so this should be a little bit faster. With this change _getProperty becomes a more "official" API, so some small changes had to be made to classes which do not inherits from Products.ERP5Type.Base.Base, so that they also implements _getProperty: - for ERP5Site we simply use getProperty - for the test class from testERP5Catalog, the change is a bit more important, because this class never defined getProperty, so during that test we were just acquiring a getProperty from portal.
-
- 15 May, 2019 1 commit
-
-
Vincent Pelletier authored
Even if it does not lead to ConflictError being raised, updating _max_uid has a cost and a transaction-serialising effect (most noticeable with NEO). This value is not used (outside of a bootstrap value for portal_ids generator), so stop doing this unnecessary work. Also, fold produceUid into its only caller. Also, change the folded pattern to react to an empty buffer rather than test for emptiness before each access.
-
- 26 Mar, 2019 2 commits
-
-
Vincent Pelletier authored
-
Vincent Pelletier authored
-
- 07 Dec, 2018 1 commit
-
-
Ayush Tiwari authored
[erp5_core] Follow guidelines for Actions on portal types Catalog and Catalog Tool by adding dialog before executing Also, Cleanup useless actions and functions /reviewed-on !811
-
- 03 Sep, 2018 1 commit
-
-
Vincent Pelletier authored
-
- 01 Sep, 2018 3 commits
-
-
Vincent Pelletier authored
Auto-generate cache_id, removing the risk of duplicating one. Inline getInstanceID as it is its only caller left. Avoid wrapping if getTransactionalVariable cannot be imported. Avoid intermediate variables, at the cost of dupicating logic but accelerating run-time. Use functools.wraps . Access _cache_sequence_number directly - these pieces of code are friends anyway, we already set a volatile property on Catalog instance. Saves one getattr and one call.
-
Vincent Pelletier authored
No backslash at EOL. Avoid splitting messages, to ease code lookup. LOG's "error" argument accepts a boolean, which removes the need to touch sys.exc_info. Use modern exception raising syntax.
-
Vincent Pelletier authored
-
- 20 Mar, 2018 5 commits
-
-
Vincent Pelletier authored
Document why this method tolerates unhandled method types.
-
Vincent Pelletier authored
LIMIT hides duplicates. We want to know if we ever violate the soft-constraint of path unicity in catalog, so stop setting a LIMIT. Also, for uid lookup, LIMIT is meaningless as this is ha hard unicity constraint (must be enforced by relational database for ERP5 to work). Also, simplify both the DTML and the SQL by having fewer ways to be invoked (backward-compatible).
-
Vincent Pelletier authored
When _reindexObjectList receives a document more than once (which may happen when multiple different-tag indexation activities are spawned for the same document), it would emit a meaningless error, saying that document /foo/bar stole the uid of document /foo/bar. Instead, fix duplicate tracking and skip such dulicates. Also, simplify & make _reindexObjectList more robust: - Always check path length. - Allocate uids before looking for duplicates in catalog (it may not be actually needed at this level nowadays). - Always check both uid-to-path and path-to-uid mappings. - Reuse existing mappings to detect duplicates among objects being reindexed, removing the need for assigned_uid_dict. - Avoid computing path more than once, as it's expensive.
-
Vincent Pelletier authored
ZSQLCatalog now requires having portal_ids. Keep support for clearing existing ones. Any existing "reserved" row encountered while indexing documents will be treated as a uid being attributed to more than one path.
-
Vincent Pelletier authored
-
- 22 Jan, 2018 1 commit
-
-
Vincent Pelletier authored
Such tables are not visible in the ZMI (which is arguably a bug on its own, although the ZMI is deprecated), but even accessing the setting tab is broken as it runs these methods. This change at least allows accessing stuff to start fixing.
-
- 11 Dec, 2017 1 commit
-
-
Vincent Pelletier authored
For type checking (not recommended, but sometimes useful). Expose it as BaseQuery, to avoid conflict with AutoQuery original name.
-
- 30 Nov, 2017 1 commit
-
-
Ayush Tiwari authored
[erp5_core]: No need to have export_properties action for ERP5 Catalog as we do cleanup of old manage_exportProperties function
-
- 20 Nov, 2017 1 commit
-
-
Ayush Tiwari authored
Move from SQLCatalog to ERP5Catalog as the default Catalog inside ERP5. The major difference is use of Products.ERP5Type.Core.Folder as Catalog base class. Significant addition/changes in ------------------------------- ERP5Catalog class: Inherit from Catalog class from Products.ZSQLCatalog.SQLCatalog instead of copy-pasting the whole code again. Monkey patch some property setters and getters to maintain consistency Override getCatalogMethodIds cause it uses global variable in SQLCatalog.Catalog Add FilterDict and Filter class to have consistency with `filter_dict` attribute of SQLCatalog BusinessTemplate: Update BusinessTemplate installation with updated filter_dict Also, use dynamic migration while installing the catalog method objects for bt5. This way we have SQL Methods migrated just after installation. Tests: Update tests according to changes in portal_catalog SQLCatalog, testZSQLCatalog: Cleanup for unusable functions
-