Skip to content

Commit

Permalink
deepsource fixes1
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansev committed Jul 12, 2024
1 parent d6ed53f commit 3fa67f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions alienpy/alien.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import json
import signal
from pathlib import Path
import re
import subprocess # nosec
import logging
import shlex
Expand Down Expand Up @@ -61,7 +60,7 @@ def shlex_join(split_command: list) -> str: return ' '.join(shlex.quote(arg) for
## SSL RELATED VARIABLES: TOKEN AND CERT NAMES
from .connect_ssl import CertInfo, CertKeyMatch, CertVerify
## General misc functions library
from .tools_nowb import (GetHumanReadableSize, PrintColor, ccdb_json_cleanup, check_port, cleanup_temp, convert_jdl2dict, convert_time, convert_trace2dict,
from .tools_nowb import (GetHumanReadableSize, PrintColor, ccdb_json_cleanup, check_port, convert_jdl2dict, convert_time, convert_trace2dict,
deltat_ms_perf, dequote, exit_message, exitcode, file2file_dict, file2list, getCAcerts,
get_arg, get_arg_multiple, get_arg_value, get_lfn_key, import_aliases, is_help, list_remove_item,
md5, mk_xml_local, name2regex, queryML, signal_handler, unixtime2local)
Expand Down Expand Up @@ -802,7 +801,7 @@ def DO_ccdb_query(args: list = None) -> RET:

# clean up redundant entries from object description
# list(map(ccdb_json_cleanup, q_dict['objects']))
[ccdb_json_cleanup(q) for q in q_dict['objects']]
for q in q_dict['objects']: ccdb_json_cleanup(q)

dir_list = [f'{d}/' for d in q_dict['subfolders']]
msg_dirs = f'{os.linesep}'.join(dir_list) if dir_list else ''
Expand Down
2 changes: 1 addition & 1 deletion alienpy/tools_nowb.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def get_arg_value_multiple(target: list, item: str) -> list:
for idx, x in enumerate(target):
if x == item:
# if current index (starts at 0) is greater then len - 1, just return
if idx + 1 + 1 > arg_list_size: return val
if idx + 1 + 1 > arg_list_size: return val_list
val_list.append(target[idx + 1])
idx_to_be_removed.append(idx + 1)

Expand Down
5 changes: 2 additions & 3 deletions alienpy/xrd_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .wb_api import SendMsg, retf_print
from .tools_nowb import (GetHumanReadableSize, PrintColor, common_path, create_metafile, deltat_ms_perf,
fileIsValid, fileline2list, format_dst_fn, get_arg, get_arg_value, get_arg_value_multiple, get_hash_meta, get_lfn_key, get_lfn_name, get_size_meta,
is_help, is_int, list_files_local, make_tmp_fn, md5, name2regex, now_str, path_local_stat, path_writable_any, valid_regex, unixtime2local)
is_help, is_int, list_files_local, make_tmp_fn, md5, name2regex, now_str, path_local_stat, path_writable_any, valid_regex)
from .xrd_tools import commitFileList, expand_path_grid, extract_glob_pattern, lfn2fileTokens, list_files_grid, path_grid_stat, path_type, pathtype_grid, xrdcp_help, lfnIsValid


Expand Down Expand Up @@ -129,8 +129,7 @@ def xrdfile_set_attr(uri: str = '', xattr_list: Optional[list] = None):
mode = OpenFlags.READ | OpenFlags.UPDATE | OpenFlags.WRITE
with xrd_client.File() as f:
status, response = f.open(uri, mode)
print(status)
print(respons)
print(f'{status}\n{response}')

status, list_of_statuses = f.set_xattr(attrs = xattr_list)
print(status)
Expand Down

0 comments on commit 3fa67f0

Please sign in to comment.