Archive for the 'Python' Category

Page 3 of 4

我用MoinMoin做PIM

1. 个人日志 Macro: MonthCalendar, Include
wikihome.jpg

2. 文献管理 Parser: BibTex
bibtex.jpg

3. 记帐 Parser: accountbook Macro: MonthCalendar, AccountBook

这个叫AccountBook的parser和macro是我在老婆的强烈要求下写的。昨天刚刚达到可以使用的阶段。

accountbook.jpg

4. 常用网站链接 Macro: RssReader
5. 管理搜集的电子书 Parser: BibTex
……

theme用的是sinorca4moin,比较喜欢。

我把用到的MoinMoin扩展都收集到del.icio.us了。http://del.icio.us/wolfg/MoinMoinExtensions

在MoinMoin里浏览mind-mapping图

需要安装FreeMindBrowser这个宏。

使用方法:

[[FreeMindBrowser( mindmapUrl, width, height )]]

我的MoinMoin的版本是Desktop Edition 1.5.2-1,需要一点点hack,方法见这里。也可以从这里直接下载patch文件。

使用MoinMoin Wiki进行文献管理 - 安装BibTex Parser

BibTex Parser需要bibtex2html的支持。

先下载bibtex2html。我是在Windows XP上使用MoinMoin Desktop Edition,所以选择Windows版本的bibtex2html,版本为1.79。下载后放到Miktex的bin目录下(我使用CTex,这个目录是C:\CTeX\texmf\miktex\bin)。

bibtex.py需要放到MoinMoin的数据目录中(DATA-DIR/plugin/parser),DATA-DIR是在wikiconfig.py 中指定的那个目录。

需要修改bibtex.py,第177和178行,指定bibtex2html.exe和bibtex.exe的位置。由于这两个程序都在C:\CTeX\texmf\miktex\bin目录下,已经包含在PATH环境变量里了,所以这里改成下面这样就可以:

bibtex2html = 'bibtex2html.exe'
bibtex = 'bibtex.exe'

但不知为什么 bibtex2html.exe 的stdin和stdout在Windows下无法工作,解析不了BibTex标记,所以我改成使用临时文件的方式。改动后的bibtex.py可以在这里下载(也可以用这个patch文件)。

现在,可以从Google Scholar导出BibTex放进Wiki页面了。

{ { {#!bibtex
@Book{aho.74,
author= {Alfred V. Aho and John E. Hopcroft and Jeffrey D. Ullman},
title = {The Design and Analysis of Computer Algorithms},
publisher= {Addison-Wesley},
year  = {1974},
}
} } }

PyS60中使用中文

  1. # -*- coding: utf-8 -*-
  2. import appuifw
  3. appuifw.note("你好".decode("utf8"), "info")

安装MoinMoin Wiki后的简单配置

访问已运行的Wiki,http://localhost/mywiki
注册一个新的用户,比如admin。

wikiconfig.py的修改如下:

1. 设置默认的访问权限:

superuser = [u"admin", ]
这句设定刚建的admin用户为superuser
acl_rights_default = 'All:'
acl_rights_before = u'admin:read,write,delete,revert,admin Known:read,write'
这里,我设置的权限是:默认没有任何权限,必须登录才能使用Wiki;admin用户具有管理员的权限;其他用户登录后可以读写Wiki。(好像和Wiki的精神不符啊。 文档里有几种典型的权限配置供参考)
重启Apache,让配置生效。

2. 配置MoinMoin使用中文

用admin用户登录,按照Wiki的提示,访问SystemPagesSetup页,安装所需的简体中文包。

navi_bar = [
# If you want to show your page_front_page here:
u'%(page_front_page)s',
u'RecentChanges',
u'FindPage',
u'HelpContents',
]
在导航里显示FrontPage链接

设置默认语言为中文
language_default = 'zh'

page_category_regex = u'^Category[A-Z]|类$'
page_dict_regex = u'[a-z]Dict$|字典$'
page_form_regex = u'[a-z]Form$|表$'
page_group_regex = u'[a-z]Group$|组$'
page_template_regex = u'[a-z]Template$|模板$'

保存wikiconfig.py后记得重启Apache。

参考




This work by wolfg is licensed under a Attribution-Noncommercial-Share Alike 2.5 China Mainland.