小编yeg*_*ich的帖子

交叉编译Python扩展

我在Buildroot Linux发行版ARM(Python 2.7.2)下交叉编译netifaces扩展时遇到了问题.根据这个博客http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/我已经定义了CC,LDSHARE等环境变量,但是distutils/setuptools没有将CC带入帐户,所以所有测试都将失败:

running build
Setting prefix
Setting prefix
running build_ext
checking for getifaddrs... not found. (cached)
checking for getnameinfo... not found. (cached)
checking for socket IOCTLs... not found. (cached)
checking for optional header files... netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h. (cached)
checking whether struct sockaddr has a length field... no. (cached)
checking which sockaddr_xxx structs are defined... at ax25 in in6 ipx un ash ec ll  atmpvc atmsvc dn irda llc. (cached) …
Run Code Online (Sandbox Code Playgroud)

python distutils setuptools cross-compiling

15
推荐指数
1
解决办法
5949
查看次数

Python:ttk:禁用/启用按钮

我想根据一些内部逻辑改变ttk.Button的状态.我创建了一个按钮并将样式与它相关联:

cardBtnStyle = ttk.Style()
cardBtnStyle.configure('CB.TButton')
cardBtn = ttk.Button(top, text="Make SD card", style='CB.TButton', command = cardCreateCallBack).grid(column=1, row=5)
Run Code Online (Sandbox Code Playgroud)

以下声明无效:

style.configure('CB.TButton', state='disabled')
Run Code Online (Sandbox Code Playgroud)

但是当我创建这样的按钮时,它被禁用:

cardBtn = ttk.Button(top, text="Make SD card", style='CB.TButton', state='disabled', command = cardCreateCallBack).grid(column=1, row=5)
Run Code Online (Sandbox Code Playgroud)

如何在Python中更改ttk.Button状态?

操作系统:Ubuntu 13.10

Python:2.7.5+

python ttk

8
推荐指数
1
解决办法
1万
查看次数

OpenWrt:LuCI:如何实现有限的用户访问

目标:两个用户root和用户.Root可以通过Web界面访问所有内容,但用户只能看到菜单的某些部分.

一种选择是将"sysauth"选项传递给每个相关模块.这不太实际,因为用户会看到每个菜单条目,并且会获得不允许的每个菜单的登录页面.

我的想法是找出谁登录,然后在每个受限模块的index()函数中什么也不做.到目前为止,我无法在LuCI API(http://luci.subsignal.org/api/luci/)中找到这样的函数,它将返回当前登录的用户.

我知道如何在OpenWrt/LuCI中添加其他用户(https://forum.openwrt.org/viewtopic.php?pid=163013#p163013).但它只是解决方案的一部分.

任何想法,如何实现我的目标?

authentication lua openwrt

5
推荐指数
1
解决办法
1万
查看次数

如何解决此错误——在编译 socketcan 实用程序时

我已经从 SVN 下载了 can 实用程序。因为默认情况下,can 实用程序不在内核中。

svn checkout svn://svn.berlios.de/socketcan/trunk/can-utils
Run Code Online (Sandbox Code Playgroud)

我使用的内核是:--

ignite@ignite:~/socketcan/can-utils$ uname -a
Linux ignite 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

然后我重新编译了实用程序。这是找不到错误 isotp.h :---

ignite@ignite:~/socketcan/can-utils$ make all
cc -O2 -Wall -Wno-parentheses -I../kernel/2.6/include -fno-strict-aliasing -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN    isotprecv.c   -o isotprecv
isotprecv.c:60:29: fatal error: linux/can/isotp.h: No such file or directory
compilation terminated.
make: *** [isotprecv] Error 1
cc -O2 -Wall -Wno-parentheses -I../kernel/2.6/include -fno-strict-aliasing -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN    isotpsend.c   -o isotpsend
isotpsend.c:60:29: fatal error: linux/can/isotp.h: No such …
Run Code Online (Sandbox Code Playgroud)

linux can-bus socketcan

3
推荐指数
1
解决办法
1763
查看次数