1
1
import errno
2
- import logging
3
- import re
4
2
import glob
3
+ import logging
5
4
import os
5
+ import re
6
6
7
- from genomespaceclient import storage_handlers
8
7
from genomespaceclient import gs_glob
8
+ from genomespaceclient import storage_handlers
9
9
from genomespaceclient .exceptions import GSClientException
10
10
11
11
import requests
@@ -462,9 +462,9 @@ def copy(self, source, destination, recurse=False):
462
462
Copies a file to/from/within GenomeSpace.
463
463
464
464
E.g.
465
-
466
- client.copy("/tmp/local_file.txt",
467
- "https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt")
465
+ .. code-block:: python
466
+ client.copy("/tmp/local_file.txt",
467
+ "https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt")
468
468
469
469
:type source: :class:`str`
470
470
:param source: Local filename or GenomeSpace URL of source file.
@@ -495,9 +495,9 @@ def move(self, source, destination):
495
495
Moves a file within GenomeSpace.
496
496
497
497
E.g.
498
-
499
- client.move("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt",
500
- "https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt")
498
+ .. code-block:: python
499
+ client.move("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt",
500
+ "https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt")
501
501
502
502
:type source: :str:
503
503
:param source: GenomeSpace URL of source file. Cannot be a local file.
@@ -521,8 +521,8 @@ def list(self, genomespace_url):
521
521
Returns a list of files within a GenomeSpace folder.
522
522
523
523
E.g.
524
-
525
- client.list("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/")
524
+ .. code-block:: python
525
+ client.list("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/")
526
526
527
527
:type genomespace_url: :class:`str`
528
528
:param genomespace_url: GenomeSpace URL of folder to list.
@@ -540,8 +540,8 @@ def delete(self, genomespace_url, recurse=False):
540
540
Deletes a file within a GenomeSpace folder.
541
541
542
542
E.g.
543
-
544
- client.delete("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt")
543
+ .. code-block:: python
544
+ client.delete("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt")
545
545
546
546
:type genomespace_url: :class:`str`
547
547
:param genomespace_url: GenomeSpace URL of file to delete.
@@ -592,7 +592,8 @@ def mkdir(self, genomespace_url, create_path=True):
592
592
Creates a folder at a given location.
593
593
594
594
E.g.
595
- client.mkdir("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/Folder1")
595
+ .. code-block:: python
596
+ client.mkdir("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/Folder1")
596
597
597
598
:type genomespace_url: :class:`str`
598
599
:param genomespace_url: GenomeSpace URL of file to delete.
@@ -618,7 +619,9 @@ def get_metadata(self, genomespace_url):
618
619
619
620
E.g.
620
621
621
- client.get_metadata("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt")
622
+ .. code-block:: python
623
+
624
+ client.get_metadata("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt")
622
625
623
626
:type genomespace_url: :class:`str`
624
627
:param genomespace_url: GenomeSpace URL of file to delete.
@@ -639,14 +642,16 @@ def get_remaining_token_time(self, genomespace_url):
639
642
If you don't have one, will return 0, as the non existent token has
640
643
no time left to live. See:
641
644
http://www.genomespace.org/support/api/restful-access-to-identity-server#get_token_time
642
-
643
- E.g.
644
-
645
- client.get_remaining_token_time('https://genomespace.genome.edu.au/')
646
-
645
+
646
+ E.g.
647
+
648
+ .. code-block:: python
649
+
650
+ client.get_remaining_token_time('https://genomespace.genome.edu.au/')
651
+
647
652
:type genomespace_url: :class:`str`
648
653
:param genomespace_url: GenomeSpace URL.
649
-
654
+
650
655
:rtype: :class:`int`
651
656
:return: the time the token has left to live in milliseconds.
652
657
"""
0 commit comments