{"id":255116,"date":"2015-04-13T16:47:03","date_gmt":"2015-04-13T12:47:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=255116"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=255116","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 Python"},"content":{"rendered":"<p>     \t<a href=\"http:\/\/habrahabr.ru\/company\/acronis\/blog\/249963\/\"><img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/e91\/ba0\/95d\/e91ba095d5534c389a3ca976f07e0085.jpg\" align=\"left\" height=\"215\"\/><\/a> \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2013 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python. <\/p>\n<p>  \u042f\u0437\u044b\u043a Python \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u043c, \u043d\u043e \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u043e \u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0432 Windows \u0438 Linux \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u0418 \u0435\u0441\u043b\u0438 \u0412\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0442\u043e \u0431\u0435\u0437 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0432\u0430\u043c \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0427\u0435\u0440\u043f\u0430\u0442\u044c \u0438\u0434\u0435\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437 \u0441\u0430\u043c\u043e\u0439 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u044f\u0437\u044b\u043a\u0430 Python \u2014 <i>os.py<\/i>. \u0412 \u043d\u0435\u0439 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0414\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043d\u0430\u0431\u043e\u0440 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python \u0440\u0430\u0437\u043d\u044b\u0439. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432 \u044d\u0442\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043a\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f <i>os<\/i>.<\/p>\n<pre><code class=\"python\">_names = sys.builtin_module_names  # Note:  more names are added to __all__ later. __all__ = [&quot;altsep&quot;, &quot;curdir&quot;, &quot;pardir&quot;, &quot;sep&quot;, &quot;extsep&quot;, &quot;pathsep&quot;, &quot;linesep&quot;,            &quot;defpath&quot;, &quot;name&quot;, &quot;path&quot;, &quot;devnull&quot;,            &quot;SEEK_SET&quot;, &quot;SEEK_CUR&quot;, &quot;SEEK_END&quot;]  def _get_exports_list(module):     try:         return list(module.__all__)     except AttributeError:         return [n for n in dir(module) if n[0] != '_']  if 'posix' in _names:     name = 'posix'     linesep = '\\n'     from posix import *     try:         from posix import _exit     except ImportError:         pass     import posixpath as path      import posix     __all__.extend(_get_exports_list(posix))     del posix <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043a\u043e\u0440\u0442\u0435\u0436 names \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0443\u043b\u044f<i> __all__<\/i> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <i>from os import *<\/i>. \u0415\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c <i>\u00abposix\u00bb<\/i>, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0434\u043b\u044f posix \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043a\u043e\u0434, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 <i>os.__all__<\/i>. \u0417\u0430\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 posix, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0432\u044b\u0437\u043e\u0432\u0443 <i>os.posix<\/i>, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u044f posix \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>os.\u043e\u0431\u044a\u0435\u043a\u0442_\u043c\u043e\u0434\u0443\u043b\u044f_posix<\/i>. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0434\u043b\u044f Windows, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e posix \u2014 nt. <\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 Windows \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0443\u043b\u044c nt. Posix, solaris \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043d\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0438. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u0422\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443, \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0434\u0435\u044e \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.<\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445:<\/p>\n<p>  \u0412 Linux:<\/p>\n<pre><code class=\"bash\">mount \/\/server\/share \/mount_point -o user=user,pass=password <\/code><\/pre>\n<p>  \u0412 Mac OSX:<\/p>\n<pre><code class=\"bash\">mount_smbfs \/\/user:password@server\/share \/mount_point <\/code><\/pre>\n<p>  \u0412 windows:<\/p>\n<pre><code class=\"dos\">net use z: \\\\server\\share \/user:user password <\/code><\/pre>\n<p>  \u041d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0443\u0436 \u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435 server, share, user \u0438 password. \u0412\u0441\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 server, share, user, password, mount_point (\u0434\u043b\u044f win \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0431\u0443\u043a\u0432\u0430 \u0434\u0438\u0441\u043a\u0430).<\/p>\n<h2><font color=\"#00204D\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/font><\/h2>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/7af\/bec\/1a9\/7afbec1a98ae483d9c251053047552b5.png\"\/><\/p>\n<h3><font color=\"#00204D\">__init__.py<\/font><\/h3>\n<p>  \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u043f\u0430\u043f\u043a\u0430 mounter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c<\/li>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 mounter, \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/li>\n<\/ol>\n<p>  <\/p>\n<pre><code class=\"python\">if sys.platform == &quot;win32&quot;:     from mounter.win import * if sys.platform == &quot;darwin&quot;:     from mounter.osx import * if sys.platform == &quot;linux2&quot;:     from mounter.linux import * <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#00204D\">base.py<\/font><\/h3>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u043c\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b.<\/p>\n<pre><code class=\"python\">import os from subprocess import Popen, PIPE  class MounterBase():     mount_cmd = None     umount_cmd = None     mount_point = None     network_folder = None      def _prepare(self):         if not os.path.exists(self.mount_point):             print 'creating %s folder for mounting' % self.mount_point             os.makedirs(self.mount_point)     def mount(self):         self._prepare()         Popen(self.mount_cmd, stdout=PIPE, stderr=PIPE, shell=True)     def umount(self):         Popen(self.umount_cmd, stdout=PIPE, stderr=PIPE, shell=True) <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043a\u043b\u0430\u0441\u0441 MounterBase \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 <i>win.py<\/i>, <i>osx.py<\/i>, <i>linux.py<\/i> \u0438 \u043f\u043e\u043a\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u044b\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<h3><font color=\"#00204D\">linux.py<\/font><\/h3>\n<p>  <\/p>\n<pre><code class=\"python\">import mounter  class Mounter(mounter.MounterBase):     def __init__(self, network_folder, mount_point, user, password):         mount_cmd = &quot;mount {network_folder} {mount_point} -o user={user},pass={password}&quot;         self.mount_cmd = mount_cmd.format(network_folder=network_folder,                                           mount_point=mount_point,                                           user=user,                                           password=password)         self.umount_cmd = &quot;umount {mount_point}&quot;.format(mount_point=mount_point) <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Linux, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u041c\u0430\u043a\u0430 \u0438 Windows.<\/p>\n<h3><font color=\"#00204D\">osx.py<\/font><\/h3>\n<p>  <\/p>\n<pre><code class=\"python\">class Mounter(mounter.MounterBase):     def __init__(self, network_folder, mount_point, user, password):         mount_cmd = &quot;mount_smbfs \/\/{user}:{password}@{network_folder} {mount_point}&quot;         self.mount_cmd = mount_cmd.format(network_folder=network_folder,                                             mount_point=mount_point,                                             user=user,                                             password=password)         self.umount_cmd = &quot;umount {mount_point}&quot;.format(mount_point=mount_point) <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#00204D\">win.py<\/font><\/h3>\n<p>  <\/p>\n<pre><code class=\"python\">class Mounter(mounter.MounterBase):     def __init__(self, network_folder, mount_point, user, password):         network_folder =network_folder.replace(&quot;\/&quot;, &quot;\\\\&quot;)         mount_cmd = &quot;net use {mount_point} \\\\{network_folder} \/user:{user} {password}&quot;         self.mount_cmd = mount_cmd.format(network_folder=network_folder,                                             mount_point=mount_point,                                             user=user,                                             password=password)         self.umount_cmd = &quot;net use {mount_point} \/delete \/y&quot;.format(mount_point=mount_point) <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <i>mount()<\/i> \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <i>mounter.Mounter()<\/i>:<\/p>\n<pre><code class=\"python\">import mounter  ... mount_point = &quot;\/mnt\/mount_moint&quot; share = mounter.Mounter(&quot;server\/share&quot;, mount_point, &quot;guest&quot;, &quot;secret_password&quot;) share.mount() copy_requared_files(source=mount_point, dest=&quot;\/tmp&quot;) share.umount() <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438. \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432\u0430\u043c.<\/p>\n<p>  \u041f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 Acronis True Image for Windows \u0438 Acronis True Image for Mac. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0431\u0435\u043a\u0430\u043f\u0430, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>TrueImage.backup()<\/i>, \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0441\u043a\u0440\u0438\u043f\u0442, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u043e\u0441\u0442\u044b \u0443 \u043d\u0430\u0441 \u0432 \u0431\u043b\u043e\u0433\u0435:<br \/>  \u2013 <a href=\"http:\/\/habrahabr.ru\/post\/237971\/\">\u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 True Image<\/a><br \/>  \u2013 <a href=\"http:\/\/habrahabr.ru\/post\/234107\/\">50 \u043e\u0442\u0442\u0435\u043d\u043a\u043e\u0432 \u0441\u0438\u043d\u0435\u0433\u043e, \u0438\u043b\u0438 \u0441\u043a\u0430\u0437 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u0434\u0438\u0437\u0430\u0439\u043d True Image 2015 <\/a><br \/>  \u2013 <a href=\"http:\/\/habrahabr.ru\/post\/234287\/\">Acronis Snap Deploy 5: \u041c\u0430\u0441\u0441\u043e\u0432\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439\u043c\u0435\u043d\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e<\/a><br \/>  \u2013 <a href=\"http:\/\/habrahabr.ru\/post\/255131\/\">\u00ab\u041d\u0438 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044b\u0432\u0430!\u00bb \u0438\u043b\u0438 \u0437\u0430\u0447\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0432\u043e\u0435\u0432\u0430\u0442\u044c \u0441 \u0442\u0435\u0445\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439<\/a><br \/>  \u2013 <a href=\"http:\/\/habrahabr.ru\/post\/250145\/\">\u0421\u0442\u0430\u0434\u0438\u0438 \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435<\/a><br \/>  \u2013 <a href=\"http:\/\/habrahabr.ru\/post\/254577\/\">\u0417\u043e\u043b\u043e\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u044d\u043a\u0430\u043f\u0430<\/a>     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/249963\/\"> http:\/\/habrahabr.ru\/post\/249963\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<a href=\"http:\/\/habrahabr.ru\/company\/acronis\/blog\/249963\/\"><img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/e91\/ba0\/95d\/e91ba095d5534c389a3ca976f07e0085.jpg\" align=\"left\" height=\"215\"\/><\/a> \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2013 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python. <\/p>\n<p>  \u042f\u0437\u044b\u043a Python \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u043c, \u043d\u043e \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u043e \u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0432 Windows \u0438 Linux \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u0418 \u0435\u0441\u043b\u0438 \u0412\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0442\u043e \u0431\u0435\u0437 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0432\u0430\u043c \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-255116","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=255116"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255116\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}