# Path: mico/lib/core/dir.py
# def dir_ensure(location, recursive=True, mode=None, owner=None, group=None):
#     """Ensures that there is a remote directory at the given location,
#     optionally updating its mode/owner/group.
# 
#     If we are not updating the owner/group then this can be done as a single
#     ssh call, so use that method, otherwise set owner/group after creation.
#     """
#     _x = None
#     if not dir_exists(location):
#         _x = run("mkdir %s '%s'" % (recursive and "-p" or "", location))[0]
#         if _x.return_code != 0:
#             mico.output.error("unable to create directory %s" % location)
#             return
#         else:
#             mico.output.info("created directory %s" % location)
# 
#     if owner or group or mode:
#         return dir_attribs(location, owner=owner, group=group, mode=mode, recursive=recursive)
#     else:
#         return _x


import os
import base64
import hashlib
import tempfile
import __builtin__
import fabric
import mico.path
import mico.output
import mico.util.storage
from jinja2 import Environment, FileSystemLoader
from mico.lib.core.dir import dir_ensure
from mico.lib.core.local import *
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
# vim:fenc=utf-8:

"""The file core submodule provide a useful way to create, delete and manage
files in the remote and local host."""






revision_repo = mico.util.storage.RevisionStorage(
        os.path.join(mico.path.get_cache_path(), __name__)

# Path: mico/lib/core/dir.py
# def dir_ensure(location, recursive=True, mode=None, owner=None, group=None):
#     """Ensures that there is a remote directory at the given location,
#     optionally updating its mode/owner/group.
# 
#     If we are not updating the owner/group then this can be done as a single
#     ssh call, so use that method, otherwise set owner/group after creation.
#     """
#     _x = None
#     if not dir_exists(location):
#         _x = run("mkdir %s '%s'" % (recursive and "-p" or "", location))[0]
#         if _x.return_code != 0:
#             mico.output.error("unable to create directory %s" % location)
#             return
#         else:
#             mico.output.info("created directory %s" % location)
# 
#     if owner or group or mode:
#         return dir_attribs(location, owner=owner, group=group, mode=mode, recursive=recursive)
#     else:
#         return _x


# Path: mico/lib/core/file.py
import os
import base64
import hashlib
import tempfile
import __builtin__
import fabric
import mico.path
import mico.output
import mico.util.storage
from jinja2 import Environment, FileSystemLoader
from mico.lib.core.dir import dir_ensure
from mico.lib.core.local import *

#! /usr/bin/env python
# -*- encoding: utf-8 -*-
# vim:fenc=utf-8:

"""The file core submodule provide a useful way to create, delete and manage
files in the remote and local host."""






revision_repo = mico.util.storage.RevisionStorage(
        os.path.join(mico.path.get_cache_path(), __name__)

)