You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Development of various interfaces (DIRAC commands, COMDIRAC commands, DIRAC.API, Rest, etc...) can lead to duplicate large portions of code. This could be avoided by gathering these functions inside a package that could be used in a standard way from other DIRAC interfaces.
An example of such a code duplication arises from the COMDIRAC (https://github.com/DIRACGrid/COMDIRAC) package commands that intensively reuses FileCatalogClientCLI methods. When it is needed to adapt these methods behaviour, for example changing output format of the method, this would require to copy the method's code into COMDIRAC package.
Proposed implementation
To solve this problem, various packages could be created inside Interfaces/Utilities/ source directory.
For example, there could be a Interfaces/Utilities/FileCatalogUtilities.py module providing a buildMetaDict() function that could build a metadata query dictionary from commandline arguments (and replace the FileCatalogClientCLI.__createQuery() method). This function could then be reused in command dfind with a different output than FileCatalogClientCLI.do_find().