FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-irods-cli/cli/basic_commands.py at master · alexlemann/python-irods-cli · GitHub
alexlemann
python-irods-cli
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-irods-cli
/
cli
/
basic_commands.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (40 loc) · 1.49 KB
Breadcrumbs
python-irods-cli
/
cli
/
basic_commands.py
Copy path
File metadata and controls
48 lines (40 loc) · 1.49 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import
shutil
from
irods_cli
import
cli
import
click
@
cli
.
command
()
@
click
.
argument
(
'path'
)
#TODO @click.option('-p', is_flag=True, help='no error if existing, make parent directories as needed')
@
click
.
pass_context
def
mkdir
(
ctx
,
path
):
ctx
.
obj
[
'session'
].
collections
.
create
(
path
)
@
cli
.
command
()
@
click
.
argument
(
'source_path'
)
@
click
.
argument
(
'destination_collection_path'
)
#@click.option('--recursive','-R', is_flag=True, help='use a long listing format')
def
cp
(
ctx
,
source_data_object
,
destination_path
):
ctx
.
obj
[
'session'
].
data_objects
.
copy
(
source_data_object
,
destination_path
)
@
cli
.
command
()
@
click
.
argument
(
'source_path'
)
@
click
.
argument
(
'destination_collection_path'
)
def
mv
(
ctx
,
source_path
,
parent_collection_path
):
pass
@
cli
.
command
()
@
click
.
argument
(
'path'
)
#@click.option('--recursive','-R', is_flag=True, help='use a long listing format')
#@click.option('--force','-f', is_flag=True, help='force the operation')
def
rm
(
ctx
,
path
):
pass
@
cli
.
command
()
@
click
.
argument
(
'collection_path'
)
def
rmcol
(
ctx
,
collection_path
):
pass
@
cli
.
command
()
@
click
.
argument
(
'local_path'
)
@
click
.
argument
(
'remote_collection_path'
)
@
click
.
pass_context
def
put
(
ctx
,
local_path
,
remote_collection_path
):
filename
=
os
.
path
.
basename
(
local_path
)
data_object_path
=
remote_collection_path
+
'/'
+
filename
data_object
=
ctx
.
obj
[
'session'
].
data_objects
.
create
(
data_object_path
)
with
data_object
.
open
(
'w'
)
as
remote
,
open
(
local_path
,
'r'
)
as
local
:
shutil
.
copyfileobj
(
local
,
remote
)
Back
|
FazBrowse Home
|
New Git URL