1 Star 0 Fork 0

linglingier / webview-tab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
q5.py 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
linglingier 提交于 2023-10-21 22:46 . first
#! /usr/bin/python
# -*- coding: utf-8 -*-
# author:jatvsjat
# datetime:2019/8/26 17:30
# software: PyCharm
import os, shutil
import re
def convert_path(path):
seps = r'\/'
sep_other = seps.replace(os.sep, '')
return path.replace(sep_other, os.sep)
def list_dir(path):
dirs = []
for path, name, filenames in os.walk(path):
print(path)
dirs.append(path)
return dirs
def copyapp(conf_files, path, distpath):
if len(conf_files) > 0:
for file in conf_files:
f = os.path.join(path, file)
d = os.path.join(distpath, file)
if len(file.split(":\\")) > 1:
d = os.path.join(distpath, os.path.basename(file))
if os.path.exists(d) == False:
if os.path.isdir(f):
shutil.copytree(f, d)
else:
shutil.copyfile(f, d)
print("copy: %s -> %s" % (f, d))
print("#====== 导入配置文件 ======")
def main():
path = os.getcwd()
print(path)
distpath = os.path.join(path, "dist")
# 导入 设定的内容
conf_files = [
"./images",
"./conf.ini",
"./cache",
]
for dir in os.listdir(distpath):
dtpath = os.path.join(distpath, dir)
if os.path.isdir(dtpath):
# 处理配置文件
copyapp(conf_files, path, dtpath)
if __name__ == "__main__":
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lingling2tu/webview-tab.git
git@gitee.com:lingling2tu/webview-tab.git
lingling2tu
webview-tab
webview-tab
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891