我按照本教程打包我的Mac应用程序.
这些包分两步生成:
首先,我生成一个临时包pkgbuild.它只包含二进制文件
pkgbuild --root ${ROOT} --scripts ${SCRIPTS} --identifier myapp \
--version ${VERSION} --install-location ${INSTALL_DIR} %PKG%
Run Code Online (Sandbox Code Playgroud)
其中%PKG%是临时包文件名Distribution.xml.
然后我生成一个包含前一个tmp包,一个Distribution.xml,背景图像等的包productbuild:
productbuild --distribution ${DIST_FILE} --package-path ${PKG_PATH} \
--resources ${RESOURCES} ~/myapp.pkg'
Run Code Online (Sandbox Code Playgroud)Distribution.xml 看起来像这样:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<installer-gui-script minSpecVersion="1">
<title>MyApp</title>
<options hostArchitectures="x86_64"/>
<options customize="never" rootVolumeOnly="true"/>
<welcome file="Welcome.rtf"/>
<license file="license.rtf"/>
<background file="background.png" scaling="proportional" alignment="bottomleft"/>
<os-version min="10.6.6"/>
<options customize="never" require-scripts="false"/>
<product id="myapp" version="%VERSION%" />
<choices-outline>
<line choice="default">
<line choice="myapp"/>
</line>
</choices-outline>
<choice id="default"/>
<choice …Run Code Online (Sandbox Code Playgroud) 我正在尝试从二进制文件创建 deb 包,但版权文件有问题。如果我将一个名为copyright的文件放入DEBIAN文件夹中,它会抱怨两件事:
如果我将其放在下面/usr/share/doc,或者/usr/share/doc/mypackage它根本不会抱怨,但无论如何,当我打开生成的 debian 软件包时,Ubuntu 软件中心会显示许可证:未知
使用:ubuntu 环境
执行中fakeroot dpkg-deb -z8 -Zgzip --build myproj
版权文件如下所示:
Format: http://dep.debian.net/deps/dep5
Upstream-Name: myproj
Source:
Files: *
Copyright: 2013 myproj. All rights reserved.
License: Limited Use Software License Agreement
License Text Here
Run Code Online (Sandbox Code Playgroud) 我有一个小的Tkinter应用程序来显示一些串行通信.它有两个Text组件(user_input和log)和一个'Send'按钮.
当按下"发送"时,在user_input中写入的任何内容都将发送到串行.
def send_clicked(self):
data = self.user_input.get(1.0, END)[:-1] + '\0'
self.serial.write(str(data))
self.user_input.delete(1.0, END)
Run Code Online (Sandbox Code Playgroud)
此方法还每100毫秒运行一次,以在日志文本组件中显示串行输出:
def read_serial(self):
self.log.update() # display input text
self._read_character()
self.after(100, self.read_serial) # check serial again soon
def _read_character(self):
c = self.serial.read() # attempt to read a character from Serial
# was anything read?
while len(c) > 0:
# get the buffer from outside of this function
# check if character is a delimeter
if c == '\r':
c = '' # don't want returns. chuck it
if …Run Code Online (Sandbox Code Playgroud) 鉴于这种:
class MyClass {
static class A {
public boolean property() {
return Math.random() < 0.5;
}
}
static List<A> filterLambda(List<A> list) {
return list.stream().filter(a -> a.property()).collect(Collectors.toList());
}
static List<A> filterMethodCall(List<A> list) {
return list.stream().filter(A::property).collect(Collectors.toList());
}
}
Run Code Online (Sandbox Code Playgroud)
PD:我知道这个问题与此类似,但是我认为这个问题没有得到正确解决。
在 Linux 32 位 Ubuntu 11 上生成了一个可执行文件,并在 32 位 Ubuntu 10 上对其进行了测试,但由于未找到“GLIBC_2.15”而失败。
我喜欢在我们的git服务器中设置一个预接收挂钩来检查配置文件,如果它无效则丢弃推送(我想根据分支名称检查某些令牌的存在).但是我已经看到了先前的钩子只是收到一个(old-rev,new-rev,refname)的列表,我发现检查文件内容的唯一方法是区分这些引用,这不是很容易.
是否有捷径可寻?使用预先挂钩它会更容易,但我想在服务器中有一个最后的障碍.
我刚开始一个python项目,我正在尝试不同的测试框架.我遇到的问题是nose2找不到我的测试:
$ nose2 --verbose
在0.000秒内进行0测试
好
而鼻子测试找到了所有
$ nosetests - 仅收集
.................................
跑了33个测试在0.004s
好
其他我可以在同一目录下使用nose2执行单个测试:
$ nose2 myproj.client.test.mypkg.mymodule_test
.
以0.007s进行1次测试
好
myproj.client.test.mypkg.mymodule_test的位置如下:
'''
Created on 18/04/2013
@author: julia
'''
from unittest import TestCase, main
import os
from myproj.client.mymodule import SUT
from mock import Mock
import tempfile
class SUTTest(TestCase):
def setUp(self):
self.folder = tempfile.mkdtemp(suffix='myproj')
self.sut = SUT(self.folder, Mock())
self.sut.init()
def test_wsName(self):
myfolder = os.path.join(self.folder, 'myfolder')
os.mkdir(myfolder)
self.sut.change_dir(myfolder)
self.assertEquals(self.SUT.name, 'myfolder')
if __name__ == "__main__":
main()
Run Code Online (Sandbox Code Playgroud)
我一直在看文档,我找不到可能的原因.
在MacOs 10.8.3上运行python 2.7.3
这可能是非常基本但是:
作为X与Y同一个类的对象,调用not x == y会导致我的调试器停止类__eq__的方法,但调用x != y不会?
是什么!=检查?它等同于is not(参考检查)吗?