Exemplo n.º 1
0
def start_simulator(force_restart = False):
    """
    Simulate cloud functionality locally.
    If *force_restart* or not already in simulation mode, restart cloud and enter simulation.
    In simulation mode, the cloud will be run locally, on multiple processors, via 
    the multiprocessing library.
    Additional logging information will be enabled.
    For more information, see 
    `PiCloud documentation <http://docs.picloud.com/cloud_simulator.html>`_
    """

    cloudinterface._setcloud(sys.modules[__name__], 'simulated', restart=force_restart)
Exemplo n.º 2
0
def setkey(api_key, api_secretkey=None, server_url=None, restart=False, immutable=False):
    """
    Connect cloud to your PiCloud account, given your *api_key*.
    Your *api_key* is provided by PiCloud on the 
    `API Keys <http://www.picloud.com/accounts/apikeys/>`_ section of the PiCloud website.
    
    The *api_secretkey* is generally stored on your machine.  However, if you have not previously used 
    this api_key or selected it in 'picloud setup', you will need to provide it.
    
    *server_url* specifies the PiCloud server to connect to.  Leave this blank to auto-resolve servers.

    *restart* forces the cloud to reconnect
    
    This command will disable the simulator if it is running.
    """
    
    cloudinterface._setcloud(sys.modules[__name__], 'network', api_key, api_secretkey, server_url, restart, immutable)
Exemplo n.º 3
0
def _launch_cloud():
    cloudinterface._setcloud(sys.modules[__name__], 'mp')
Exemplo n.º 4
0
def _launch_cloud():
    cloudinterface._setcloud(sys.modules[__name__], 'simulated' if __useSimulator else 'network', restart=True)