2 Star 0 Fork 0

优麒麟/ubuntu-kylin-software-center

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
setup.py 4.92 KB
一键复制 编辑 原始数据 按行查看 历史
dengnan 提交于 2020-12-09 14:43 . update
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import glob
from setuptools import setup
import DistUtilsExtra.command.build_extra
import DistUtilsExtra.command.build_i18n
import DistUtilsExtra.command.clean_i18n
from subprocess import call
#from DistUtilsExtra.command import build_extra
#import build_i18n_ext as build_i18n
PO_DIR = 'po'
for po in glob.glob(os.path.join(PO_DIR, '*.po')):
lang = os.path.basename(po[:-3])
mo = os.path.join(PO_DIR, 'ubuntu-kylin-software-center.mo')
target_dir = os.path.dirname(mo)
if not os.path.isdir(target_dir):
os.makedirs(target_dir)
try:
return_code = call(['msgfmt', '-o', mo, po])
except OSError:
print('Translation not available, please install gettext')
break
if return_code:
raise Warning('Error when building locales')
cmdclass ={
"build" : DistUtilsExtra.command.build_extra.build_extra,
"build_i18n" : DistUtilsExtra.command.build_i18n.build_i18n,
"clean": DistUtilsExtra.command.clean_i18n.clean_i18n,
}
data_files=[
('bin/', ['kylin-software-center']),
('../etc/dbus-1/system.d/', ['backend/aptdaemon/conf/com.kylin.softwarecenter.conf']),
('share/dbus-1/system-services/', ['backend/aptdaemon/conf/com.kylin.softwarecenter.service']),
('share/polkit-1/actions/', ['backend/aptdaemon/conf/com.kylin.softwarecenter.policy']),
('../etc/dbus-1/system.d/', ['backend/watchdog/com.kylin.watchdog.conf']),
('share/dbus-1/system-services/', ['backend/watchdog/com.kylin.watchdog.service']),
# ('lib/python3/dist-packages/ubuntu-kylin-software-center-daemon/', glob.glob('backend/aptdaemon/dbus_service')),
('share/applications/',['ubuntu-kylin-software-center.desktop']),
('share/pixmaps/',['ubuntu-kylin-software-center.svg']),
# ('share/ubuntu-kylin-software-center-daemon/', glob.glob('backend/aptdaemon/dbus_service/*.py')),
('share/ubuntu-kylin-software-center/backend/piston/', glob.glob('backend/piston/*.py')),
('share/ubuntu-kylin-software-center/backend/remote/', glob.glob('backend/remote/*.py')),
('share/ubuntu-kylin-software-center/backend/service/', glob.glob('backend/service/*.py')),
('share/ubuntu-kylin-software-center/backend/service/', glob.glob('backend/service/*.txt')),
('share/ubuntu-kylin-software-center/backend/login_impl/', glob.glob('backend/login_impl/*.py')),
('share/ubuntu-kylin-software-center/backend', glob.glob('backend/*.py')),
('share/ubuntu-kylin-software-center/data/ads/', glob.glob('data/ads/*.png')),
# ('share/ubuntu-kylin-software-center/data/category/', glob.glob('data/category/*')),
('share/ubuntu-kylin-software-center/data/icons/', glob.glob('data/icons/*.png')),
# ('share/ubuntu-kylin-software-center/data/screenshots/', glob.glob('data/screenshots/*')),
('share/ubuntu-kylin-software-center/data/tmpicons/', glob.glob('data/tmpicons/*')),
('share/ubuntu-kylin-software-center/data/winicons/', glob.glob('data/winicons/*')),
('share/ubuntu-kylin-software-center/data/screenshots/', glob.glob('data/screenshots/*')),
('share/ubuntu-kylin-software-center/data/', ['data/uksc.db']),
('share/ubuntu-kylin-software-center/data/xapiandb/', glob.glob('data/xapiandb/*')),
('share/ubuntu-kylin-software-center/models/', glob.glob('models/*')),
('share/ubuntu-kylin-software-center/res/', glob.glob('res/*.png')),
('share/ubuntu-kylin-software-center/res/', glob.glob('res/*.gif')),
('share/ubuntu-kylin-software-center/res/loading/', glob.glob('res/loading/*')),
('share/ubuntu-kylin-software-center/test/', glob.glob('test/*')),
('share/ubuntu-kylin-software-center/ui/', glob.glob('ui/*')),
('share/ubuntu-kylin-software-center/utils/', glob.glob('utils/*')),
('share/ubuntu-kylin-software-center/po/', glob.glob('po/*')),
('share/ubuntu-kylin-software-center/kydroid/', glob.glob('kydroid/*')),
('share/ubuntu-kylin-software-center/',['ubuntu-kylin-software-center.py']),
# ('../etc/xdg/autostart/',['ubuntu-kylin-software-center-autostart.desktop']),
]
#
# 函数名:找.mo文件
# Function: find .mo file
#
def find_mo_files():
data_files = []
for mo in glob.glob(os.path.join(PO_DIR, '*', 'ubuntu-kylin-software-center.mo')):
lang = os.path.basename(os.path.dirname(mo))
dest = os.path.join('share', 'locale', lang, 'LC_MESSAGES')
data_files.append((dest, [mo]))
return data_files
data_files.extend(find_mo_files())
setup(name="ubuntu-kylin-software-center",
version="1.3.10",
author="Ubuntu Kylin Team",
author_email="ubuntukylin-members@list.launchpad.net",
url="https://launchpad.net/ubuntu-kylin-software-center",
license="GNU General Public License (GPL)",
packages = [ 'ubuntu_kylin_software_center_daemon', 'ubuntu_kylin_software_center_watchdog',],
package_dir = {
'': '.',
},
install_requires = [ 'setuptools', ],
cmdclass = cmdclass,
data_files=data_files,
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ubuntukylin/ubuntu-kylin-software-center.git
git@gitee.com:ubuntukylin/ubuntu-kylin-software-center.git
ubuntukylin
ubuntu-kylin-software-center
ubuntu-kylin-software-center
master

搜索帮助