Skip to content

Commit

Permalink
添加了.gitignore,.gitattributes,修改了setup.py
Browse files Browse the repository at this point in the history
以使其能够成功执行python setup.py install命令。
  • Loading branch information
BrentJiang committed Nov 14, 2012
1 parent 9eeed2c commit 82273ba
Show file tree
Hide file tree
Showing 14 changed files with 2,104 additions and 1,923 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
168 changes: 166 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,166 @@
funfunsay.suo
*.pyc
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover

## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# ReSharper is a .NET coding add-in
_ReSharper*

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML



############
## Windows
############

# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo# Jiang

#Mr Developer
.mr.developer.cfg

# Mac crap
.DS_Store

# Jiang Sanyi
*.edb
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ecnunote
#ecnunote

ecnu note application with an android client.

Expand All @@ -17,7 +17,7 @@ the application will greet you on http://localhost:5000/ .

##~ Is it tested?

You betcha. Run the `funfunsay_tests.py` file to see the tests pass.
单元测试阶段.

##~ Setup

Expand All @@ -29,53 +29,53 @@ Compile with babel: ::

$ python setup.py compile_catalog --directory fbone/translations --locale zh -f

目前只支持将数据库安装在d:\mongodb\data\db目录下。NTService依赖于此路径。
目前只支持将数据库安装在d:\mongodb\data\db目录下。NTService依赖于此路径。

1.以管理员方式,运行cmd.exe,安装FirstService服务:用于避免系统异常关闭时mongodb2.0的无法自动启动的问题。
1.以管理员方式,运行cmd.exe,安装FirstService服务:用于避免系统异常关闭时mongodb2.0的无法自动启动的问题。
"NTService.exe -i"
2.安装MongoDB服务:
2.安装MongoDB服务:
"D:\mongodb\bin\mongod.exe" --install --dbpath "d:\MongoDB\data\db" --logpath "d:\MongoDB\data\logs\ffs.log" --directoryperdb
3.再运行:
3.再运行:
"sc config MongoDB depend= FirstService"
"net start MongoDB"
注意“=”和FirstService中间有个空格,否则命令失败。
去掉--logappend。
由于安装服务需要管理员权限,所以请以管理员方式运行控制台cmd.exe程序。
注意“=”和FirstService中间有个空格,否则命令失败。
去掉--logappend。
由于安装服务需要管理员权限,所以请以管理员方式运行控制台cmd.exe程序。

4.Babel翻译
4.1设置 Babel
接下来我们要做的是 babel 的配置。在 hello.py 的同级目录创建一个叫 babel.cfg 的文件,内容如下:
4.Babel翻译
4.1设置 Babel
接下来我们要做的是 babel 的配置。在 hello.py 的同级目录创建一个叫 babel.cfg 的文件,内容如下:

[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

4.2切换到项目的“funfunsay\”目录下(该目录包含translations和templates子目录)。
4.2切换到项目的“funfunsay\”目录下(该目录包含translations和templates子目录)。

4.3生成 messages.pot 文件,即生成翻译模板(Win)
4.3生成 messages.pot 文件,即生成翻译模板(Win)

"c:\Python27\Scripts\pybabel.exe extract -F babel.cfg -o messages.pot ."
或(Linux)
或(Linux)

"$ pybabel extract -F babel.cfg -o messages.pot ."
如果使用了lazy_gettext() 函数:
如果使用了lazy_gettext() 函数:

"$ c:\Python27\Scripts\pybabel.exe extract -F babel.cfg -k lazy_gettext -o messages.pot ."

4.4根据生成的.pot初始化zh_CN的翻译文件
4.4根据生成的.pot初始化zh_CN的翻译文件

"c:\Python27\Scripts\pybabel.exe init -i messages.pot -d translations -l zh_CN"
要确保 flask 能找到翻译内容,translations文件夹要和 templates 文件夹在同一个目录中。
然后就可以在.po文件中编辑翻译(不要编辑.pot的文件)翻译结果:
要确保 flask 能找到翻译内容,translations文件夹要和 templates 文件夹在同一个目录中。
然后就可以在.po文件中编辑翻译(不要编辑.pot的文件)翻译结果:

4.5然后编译生成.mo文件
4.5然后编译生成.mo文件

"c:\Python27\Scripts\pybabel.exe compile -d translations"

如果执行编译命令后出现错误:“UnicodeDecodeError: 'utf8' codec can't decode byte 0xbc in position 8: invalid start byte”,请手动将.po文件另存为utf-8编码后再执行。
如果执行编译命令后出现错误:“UnicodeDecodeError: 'utf8' codec can't decode byte 0xbc in position 8: invalid start byte”,请手动将.po文件另存为utf-8编码后再执行。

4.6如果需要更新翻译,则首先需要用前面4.3的命令重新生成 messages.pot 文件,然后使用下面的命令将更新的内容 merge 到原来的翻译文件(.po)中:
4.6如果需要更新翻译,则首先需要用前面4.3的命令重新生成 messages.pot 文件,然后使用下面的命令将更新的内容 merge 到原来的翻译文件(.po)中:

"c:\Python27\Scripts\pybabel.exe update -i messages.pot -d translations"

当然最后还是要用4.5的命令重新生成.mo文件。
当然最后还是要用4.5的命令重新生成.mo文件。
2 changes: 1 addition & 1 deletion dbapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dbapi.error import DbapiError
from dbapi.parsers import ModelParser, RawParser
from dbapi.utils import list_to_csv
from bson.objectid import ObjectId
import bson.objectid

# For import *
__all__ = ['API']
Expand Down

0 comments on commit 82273ba

Please sign in to comment.