Skip to content

Commit 9c45973

Browse files
fstagniclaude
andcommitted
fix: consolidate dirac-dms-add-file help into single Usage/Arguments blocks
The module docstring used two 'Usage:' / 'Arguments:' blocks separated by '**OR**'. LocalConfiguration.setUsageMessage only keeps the FIRST match of each block (re.search), so the second invocation form and the LocalFile argument were dropped from both the --help output and the generated docs. Merge both invocation forms into one Usage block and all arguments into one Arguments block so nothing is lost. Closes #7290 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a1dc25d commit 9c45973

2 files changed

Lines changed: 25 additions & 24 deletions

File tree

src/DIRAC/DataManagementSystem/scripts/dirac_dms_add_file.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,24 @@
44
# Author : Stuart Paterson
55
########################################################################
66
"""
7-
Upload a file to the grid storage and register it in the File Catalog
7+
Upload a file to the grid storage and register it in the File Catalog.
88
9-
Usage:
10-
dirac-dms-add-file [options] ... LFN Path SE [GUID]
11-
12-
Arguments:
13-
LFN: Logical File Name
14-
Path: Local path to the file
15-
SE: DIRAC Storage Element
16-
GUID: GUID to use in the registration (optional)
17-
18-
**OR**
9+
The file(s) to upload can be passed either directly as arguments, or listed in a
10+
local text file given as the only argument (one upload per line).
1911
2012
Usage:
13+
dirac-dms-add-file [options] ... LFN Path SE [GUID]
2114
dirac-dms-add-file [options] ... LocalFile ...
2215
2316
Arguments:
24-
LocalFile: Path to local file containing all the above, i.e.::
25-
26-
lfn1 localfile1 SE [GUID1]
27-
lfn2 localfile2 SE [GUID2]
17+
LFN: Logical File Name
18+
Path: Local path to the file
19+
SE: DIRAC Storage Element
20+
GUID: GUID to use in the registration (optional)
21+
LocalFile: Path to a local file listing the uploads described above, one per line, i.e.::
22+
23+
lfn1 localfile1 SE [GUID1]
24+
lfn2 localfile2 SE [GUID2]
2825
2926
Example:
3027
$ dirac-dms-add-file LFN:/formation/user/v/vhamar/Example.txt Example.txt DIRAC-USER

src/DIRAC/RequestManagementSystem/DB/RequestDB.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@
55

66
# We disable pylint no-callable because of https://github.com/PyCQA/pylint/issues/8138
77

8-
""" Frontend for ReqDB
8+
"""Frontend for ReqDB
99
10-
:mod: RequestDB
10+
:mod: RequestDB
1111
12-
=======================
12+
=======================
1313
14-
.. module: RequestDB
14+
.. module: RequestDB
1515
16-
:synopsis: db holding Requests
16+
:synopsis: db holding Requests
1717
18-
db holding Request, Operation and File
18+
db holding Request, Operation and File
1919
"""
20+
2021
import errno
2122
import random
2223
from urllib.parse import quote_plus
@@ -600,7 +601,9 @@ def getDBSummary(self):
600601

601602
operationQuery = (
602603
session.query(
603-
Operation.Type, Operation._Status, func.count(Operation.OperationID) # pylint: disable=not-callable
604+
Operation.Type,
605+
Operation._Status,
606+
func.count(Operation.OperationID), # pylint: disable=not-callable
604607
)
605608
.group_by(Operation.Type, Operation._Status)
606609
.all()
@@ -759,8 +762,9 @@ def getRequestCountersWeb(self, groupingAttribute, selectDict):
759762
groupingColumn = self._get_column("Request", groupingAttribute)
760763

761764
summaryQuery = session.query(
762-
groupingColumn, func.count(Request.RequestID)
763-
) # pylint: disable=not-callable,no-member
765+
groupingColumn,
766+
func.count(Request.RequestID), # pylint: disable=not-callable
767+
)
764768

765769
for key, value in selectDict.items():
766770
if key == "ToDate":

0 commit comments

Comments
 (0)