Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Nov 28, 2014
1 parent cc1bc84 commit 36d8a09
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/pyensae/file_helper/magic_file.py
Expand Up @@ -20,7 +20,7 @@ class MagicFile(Magics):
"""
Defines magic commands to list the content of a folder
..versionadded:: 1.1
.. versionadded:: 1.1
"""

@staticmethod
Expand Down Expand Up @@ -141,7 +141,7 @@ def runpy(self, line, cell = None):
run a python script which accepts standards input and produces standard outputs,
a timeout is set up at 10s
..versionadded:: 1.1
.. versionadded:: 1.1
"""
if line in [None, ""] :
print("Usage:")
Expand Down
16 changes: 10 additions & 6 deletions src/pyensae/remote/azure_connection.py
Expand Up @@ -11,20 +11,18 @@
class AzureClient():
"""
.. index: Azure
A simple class to access and communicate with `Azure <http://azure.microsoft.com/>`_.
It requires modules:
* `azure <https://github.com/Azure/azure-sdk-for-python>`_
* `requests <http://docs.python-requests.org/en/latest/>`_
.. index: blob, Azure
Main functionalities related to blob:
* list_containers, create_container, list_blobs, put_blob, put_block_blob_from_bytes
* put_block_blob_from_text, put_page_blob_from_file, get_blob, get_blob
.. index: blob
@example(Azure___Get the list of containers and files from a blob storage?)
The functionalities of a ``BlobService`` are described in
Expand All @@ -43,6 +41,7 @@ class AzureClient():
@example(Azure___Upload, download, to a blob storage)
The following example uploads and downloads a file on a Blob Storage.
@code
from pyensae.remote.azure_connection import AzureClient
cl = AzureClient("<blob_storage_service>",
Expand All @@ -60,6 +59,7 @@ class AzureClient():
"another_local_filename.txt")
@endcode
@endexample
Many function uses WebHCat API.
Expand All @@ -68,6 +68,7 @@ class AzureClient():
.. versionchanged::
PSEUDO, CONTAINER, SCRIPT will be passed to the script as parameters
"""

_blob_properties = [
Expand Down Expand Up @@ -108,6 +109,7 @@ def __init__(self, blob_name,
@param pseudo sometimes, the same identification is used to connect to HDInsight,
the pseudo is meant to avoid collisions
@param fLOG logging function
"""
self.account_name = blob_name
self.account_key = blob_key
Expand Down Expand Up @@ -199,6 +201,7 @@ def ls(self, blob_service, container_name = None, path = None, add_metadata = Fa
.. versionchanged:: 1.1
Parameter *add_metadata* was added and the function now returns the
property *last_modified*, parameter *as_df*
"""
res = [ ]
if container_name is None:
Expand Down Expand Up @@ -693,11 +696,12 @@ def wait_job(self, job_id, delay = 5, fLOG = noLOG):
"""
wait until a job has run or failed
@params job_id job_id
@param job_id job_id
@param delay check every N seconds
@return status
.. versionadded:: 1.1
"""
status = self.job_status(job_id)
while status["status"]["state"] in ["PREP", "RUNNING"] :
Expand All @@ -710,7 +714,7 @@ def standard_outputs(self, job_id, blob_service, container, folder):
"""
returns the standard output and error for a specific job id
@params job_id job_id or status
@param job_id job_id or status
@param blob_service returns by @see me open_blob_service
@param container_name name of a container
@parm folder folder where to download them
Expand Down
6 changes: 3 additions & 3 deletions src/pyensae/remote/magic_azure.py
Expand Up @@ -307,7 +307,7 @@ def blob_downmerge(self, line):
the command does not allow spaces in file names
..versionadded:: 1.1
.. versionadded:: 1.1
"""
spl = line.strip().split()
if len(spl) != 2 :
Expand Down Expand Up @@ -544,7 +544,7 @@ def runjython(self, line, cell = None):
See `In a python script how can I ignore Apache Pig's Python Decorators for standalone unit testing <http://stackoverflow.com/questions/18223898/in-a-python-script-how-can-i-ignore-apache-pigs-python-decorators-for-standalon>`_
..versionadded:: 1.1
.. versionadded:: 1.1
"""
if line in [None, ""] :
print("Usage:")
Expand Down Expand Up @@ -609,7 +609,7 @@ def jython(self, line, cell = None):
See `In a python script how can I ignore Apache Pig's Python Decorators for standalone unit testing <http://stackoverflow.com/questions/18223898/in-a-python-script-how-can-i-ignore-apache-pigs-python-decorators-for-standalon>`_
..versionadded:: 1.1
.. versionadded:: 1.1
"""
if line in [None, ""] :
print("Usage:")
Expand Down
10 changes: 5 additions & 5 deletions src/pyensae/remote/magic_remote_ssh.py
Expand Up @@ -409,7 +409,7 @@ def remote_ls(self, line):
%remote_ls .
..versionadded:: 1.1
.. versionadded:: 1.1
"""
ssh = self.get_connection()
df = ssh.ls(line)
Expand All @@ -424,7 +424,7 @@ def dfs_ls(self, line):
%dfs_ls .
..versionadded:: 1.1
.. versionadded:: 1.1
"""
ssh = self.get_connection()
df = ssh.dfs_ls(line)
Expand All @@ -439,7 +439,7 @@ def dfs_rm(self, line):
%dfs_rm .
..versionadded:: 1.1
.. versionadded:: 1.1
"""
ssh = self.get_connection()
df = ssh.dfs_rm(line)
Expand All @@ -454,7 +454,7 @@ def dfs_rmr(self, line):
%dfs_rmr .
..versionadded:: 1.1
.. versionadded:: 1.1
"""
ssh = self.get_connection()
df = ssh.dfs_rm(line, recursive = True)
Expand All @@ -469,7 +469,7 @@ def dfs_mkdir(self, line):
%dfs_mkdir afolder
..versionadded:: 1.1
.. versionadded:: 1.1
"""
ssh = self.get_connection()
df = ssh.dfs_mkdir(line)
Expand Down
4 changes: 2 additions & 2 deletions src/pyensae/remote/ssh_remote_connection.py
Expand Up @@ -157,7 +157,7 @@ def download(self, remotepath, localpath):
@param localpath local file
@param remotepath remote file (it can be a list, localpath is a folder in that case)
..versionchanged:: 1.1
.. versionchanged:: 1.1
remotepath can be a list of paths
"""
sftp = self.connection.open_sftp()
Expand All @@ -176,7 +176,7 @@ def download_cluster(self, remotepath, localpath, merge = False):
@param remotepath remote file (it can be a list, localpath is a folder in that case)
@param merge True to use getmerge instead of get
..versionadded:: 1.1
.. versionadded:: 1.1
"""
cget = "getmerge" if merge else "get"
if isinstance(remotepath, str):
Expand Down

0 comments on commit 36d8a09

Please sign in to comment.