linux下重新打包
smartfrogdd opened this issue · comments
smartfrogdd commented
大佬我在linux下重新编译打包了下,请问我可以上传到其他开源软件分享平台吗😊
ChaozhongLiu commented
- 能描述一下你具体做了什么么?
- 保持现在的License应该问题不大
- 请问是要上传到什么平台
- DyberPet一直在更新,版本稳定后可以尝试新版
smartfrogdd commented
您好
1.我修改了conf.py的_check_Date方法的一点代码,按照原来的代码在linux上运行会报错。这个是报错的详情
`
Traceback (most recent call last):
File "run_DyberPet.py",line 7,in <module>
File "<frozen importlib._bootstrap>",line 1178,in_find_and_load
File "<frozen importlib._bootstrap>",line 1149,in_find_and_load_unlocked
File "<frozen importlib._bootstrap>",line 690,in_load_unlocked
File "PyInstaller/loader/pyimod02_importers.py",line 419,in exec_module
File "DyberPet/DyberPet.py",line 32,in <module>
File "DyberPet/settings.py",line 165,in init
File "DyberPet/conf.py",line 788,in__init__
File "DyberPet/conf.py",line 812,in init_data
File "DyberPet/conf.py",line 868,in checkDate
File "DyberPet/conf.py",line 859,in _check_Date
UnboundLocalError:cannot access local variable 'today_exist'where it is not associated with a value
[12509]Failed to execute script 'run_DyberPet'due to unhandled exception!
`
以下是我修改后的代码
`
def _check_Date(self):
""" return today_exist, yesterday_exist """
now = datetime.now()
self.today = f"{now.year}-{now.month}-{now.day}"
today_exist, yesterday_exist = False, False # 初始化为默认值
if self.taskData['history']:
lp = self.taskData['history'][-1][0].split('-')
last_opened = datetime(year=int(lp[0]), month=int(lp[1]), day=int(lp[2]),
hour=now.hour, minute=now.minute, second=now.second)
if (now - last_opened).days == 0:
# Opened in the same day
today_exist = True
if len(self.taskData['history']) > 1:
last_2nd = self.taskData['history'][-2][0].split('-')
last_2nd_opened = datetime(year=int(last_2nd[0]), month=int(last_2nd[1]), day=int(last_2nd[2]),
hour=now.hour, minute=now.minute, second=now.second)
if (now - last_2nd_opened).days == 1:
yesterday_exist = True
else:
yesterday_exist = False
else:
yesterday_exist = False
elif (now - last_opened).days == 1:
yesterday_exist = True
return today_exist, yesterday_exist
`
2.我使用pyinstaller在linux上重新编译并打包成了deb安装包 经过测试在xorg显示环境可以正常运行
3.我会把deb安装包上传到星火应用商店,这个是一个非官方的linux软件共享平台。
ChaozhongLiu commented
好的。麻烦你保持License,同时列明这个repo哈!