@@ -91,6 +91,17 @@ def __init__(self,
91
91
self ._config_show = Command ('/config/show' )
92
92
self ._config_replace = ArgCommand ('/config/replace' )
93
93
self ._version = Command ('/version' )
94
+
95
+ # MFS COMMANDS
96
+ self ._files_cp = ArgCommand ('/files/cp' )
97
+ self ._files_ls = ArgCommand ('/files/ls' )
98
+ self ._files_mkdir = ArgCommand ('/files/mkdir' )
99
+ self ._files_stat = ArgCommand ('/files/stat' )
100
+ self ._files_rm = ArgCommand ('/files/rm' )
101
+ self ._files_read = ArgCommand ('/files/read' )
102
+ self ._files_write = FileCommand ('/files/write' )
103
+ self ._files_mv = ArgCommand ('/files/mv' )
104
+
94
105
95
106
def add (self , files , recursive = False , ** kwargs ):
96
107
"""
@@ -102,7 +113,7 @@ def add(self, files, recursive=False, **kwargs):
102
113
{u'Hash': u'QmZfF6C9j4VtoCsTp4KSrhYH47QMd3DNXVZBKaxJdhaPab',
103
114
u'Name': u'nurseryrhyme.txt'}
104
115
"""
105
- return self ._add .request (self ._client , files ,
116
+ return self ._add .request (self ._client , (), files ,
106
117
recursive = recursive , ** kwargs )
107
118
108
119
def get (self , multihash , ** kwargs ):
@@ -181,7 +192,7 @@ def block_put(self, file, **kwargs):
181
192
{u'Key': u'QmeV6C6XVt1wf7V7as7Yak3mxPma8jzpqyhtRtCvpKcfBb',
182
193
u'Size': 22}
183
194
"""
184
- return self ._block_put .request (self ._client , file , ** kwargs )
195
+ return self ._block_put .request (self ._client , (), file , ** kwargs )
185
196
186
197
def object_data (self , multihash , ** kwargs ):
187
198
r"""
@@ -240,7 +251,7 @@ def object_get(self, multihash, **kwargs):
240
251
def object_put (self , file , ** kwargs ):
241
252
"""
242
253
"""
243
- return self ._object_put .request (self ._client , file , ** kwargs )
254
+ return self ._object_put .request (self ._client , (), file , ** kwargs )
244
255
245
256
def object_stat (self , multihash , ** kwargs ):
246
257
"""
@@ -486,6 +497,55 @@ def version(self, **kwargs):
486
497
{u'Version': u'0.3...'}
487
498
"""
488
499
return self ._version .request (self ._client , ** kwargs )
500
+
501
+ def files_cp (self , source , dest , ** kwargs ):
502
+ """
503
+ MFS - Copy files into mfs
504
+ """
505
+ return self ._files_cp .request (self ._client , source , dest , ** kwargs )
506
+
507
+ def files_ls (self , path , ** kwargs ):
508
+ """
509
+ MFS - List directory contents
510
+ """
511
+ return self ._files_ls .request (self ._client , path , ** kwargs )
512
+
513
+ def files_mkdir (self , path , ** kwargs ):
514
+ """
515
+ MFS - Create directory
516
+ """
517
+ return self ._files_mkdir .request (self ._client , path , ** kwargs )
518
+
519
+ def files_stat (self , path , ** kwargs ):
520
+ """
521
+ MFS - Display file status (including it's hash)
522
+ """
523
+ return self ._files_stat .request (self ._client , path , ** kwargs )
524
+
525
+ def files_rm (self , path , ** kwargs ):
526
+ """
527
+ MFS - Remove a file
528
+ """
529
+ return self ._files_rm .request (self ._client , path , ** kwargs )
530
+
531
+ def files_read (self , path , ** kwargs ):
532
+ """
533
+ MFS - Read a file stored in MFS
534
+ """
535
+ return self ._files_read .request (self ._client , path , ** kwargs )
536
+
537
+ def files_write (self , path , file , ** kwargs ):
538
+ """
539
+ MFS - Write to a mutable file
540
+ """
541
+ return self ._files_write .request (self ._client , (path ,), file , ** kwargs )
542
+
543
+ def files_mv (self , source , dest , ** kwargs ):
544
+ """
545
+ MFS - Move MFS files
546
+ """
547
+ return self ._files_mv .request (self ._client , source , dest , ** kwargs )
548
+
489
549
490
550
###########
491
551
# HELPERS #
0 commit comments