我用 Quickly 创建了我的第一个非常简单的应用程序(基本上只是按照教程操作)。但是当我运行该程序时,我收到警告:
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction
Gtk.Window.__init__(self, type=type, **kwds)
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `OpenDialog' can't be set after construction
Gtk.Window.__init__(self, type=type, **kwds)
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `JottyWindow' can't be set after construction
Gtk.Window.__init__(self, type=type, **kwds)
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `RemoveDialog' can't be set after construction
Gtk.Window.__init__(self, type=type, **kwds)
它不会妨碍应用程序,但如果有人知道如何摆脱它们,那就太好了。
当我尝试使用“快速打包”打包应用程序时,我得到:
simon@simonsDeskTop:~/programing_with_quickly/jotty$ quickly package
.........Ubuntu packaging created in debian/
.................................................................................................................................................................................................
Command returned some WARNINGS:
----------------------------------
** (setup.py:9781): WARNING **: Fel vid sändning av inloggningsuppgifter: Fel vid sändning av meddelande: Operationen inte tillåten
----------------------------------
Ubuntu package has been successfully created in ../jotty_0.1_all.deb
抱歉,瑞典语不对,但它的意思是“发送帐户信息时出错:发送消息时出错:操作不允许”
当我尝试使用软件中心安装应用程序时,收到以下警告:
Lintian check results for /home/simon/programing_with_quickly/jotty_0.1_all.deb:
Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/bin/lintian line 108.
E: jotty: maintainer-address-malformed UNKNOWN <UNKNOWN>
然后它建议不要安装。(但是当我安装它时应用程序运行良好!)
那么,问题是,如何消除警告?
是否仅仅是因为该应用程序尚未获得 Canonical 的批准,还是有其他原因?
谢谢!
我正在运行 ubuntu 12.04
答案1
对于那些包错误,尝试在“install.py”文件中设置更多信息。
DistUtilsExtra.auto.setup(
name='chatbox',
version='0.1',
#license='GPL-3',
#author='Your Name',
#author_email='[email protected]',
#description='UI for managing …',
#long_description='Here a longer description',
#url='https://launchpad.net/chatbox',
cmdclass={'install': InstallAndUpdateDataDirectory}
)
从 author、author_email、description、long_description 中删除那些“#”字符。然后填写信息。
对于那些 GTK 警告,我认为您的 glade 设计文件存在严重错误。尝试查看您是否正确设置了它们。
答案2
对于 Gtk.py 警告,您可以修改 /usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py (第 391 行)
从:
class Window(Gtk.Window):
def __init__(self, type=Gtk.WindowType.TOPLEVEL, **kwds):
Gtk.Window.__init__(self, type=type, **kwds)
到:
class Window(Gtk.Window):
def __init__(self, type=Gtk.WindowType.TOPLEVEL, **kwds):
# type is a construct-only property; if it is already set (e. g. by
# GtkBuilder), do not try to set it again and just ignore it
try:
self.get_property('type')
Gtk.Window.__init__(self, **kwds)
except TypeError:
Gtk.Window.__init__(self, type=type, **kwds)