代码拉取完成,页面将自动刷新
同步操作将从 T涛涛娃T/git-repo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
'''
Created on 12.03.2013
@author: mputz
'''
import os
import platform
import subprocess
import sys
import stat
from repo_trace import REPO_TRACE, IsTrace, Trace
SUBPROCESSES = []
def terminateHandle(signal, frame):
for cmd in SUBPROCESSES:
if cmd:
cmd.terminate()
sys.exit(0)
def stream2str(stream):
return str(stream, encoding='UTF-8')
def isUnix():
if platform.system() == "Windows":
return False
else:
return True
def isPosix():
return platform.system() != "Windows"
def toUnixPath(path):
return path.replace('\\', '/')
def toWindowsPath(path):
return path.replace('/', '\\')
def os_link(src, dst):
if isUnix():
# requires src in relation to dst
src = os.path.relpath(src, os.path.dirname(dst))
os.symlink(src, dst)
else:
isDir = True if os.path.isdir(src) else False
src = os.path.relpath(src, os.path.dirname(dst))
src = toWindowsPath(src)
dst = toWindowsPath(dst)
# ln in MinGW does not create hard links? - it copies
# call windows cmd tool 'mklink' from git bash (mingw)
if isDir:
cmd = 'cmd /c mklink /D "%s" "%s"' % (dst, src)
if IsTrace():
Trace(cmd)
subprocess.Popen(cmd, stdout=subprocess.PIPE).wait()
else:
cmd = 'cmd /c mklink "%s" "%s"' % (dst, src)
if IsTrace():
Trace(cmd)
subprocess.Popen(cmd, stdout=subprocess.PIPE).wait()
def removeReadOnlyFilesHandler(fn, path, excinfo):
removeReadOnlyFiles(fn, path)
def removeReadOnlyFiles(fn, path):
if not os.access(path, os.W_OK):
os.chmod(path, stat.S_IWUSR)
fn(path)
else:
raise Exception("Could not delete %s" % path)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。