Giter Club home page Giter Club logo

zhpy's People

zhpy's Issues

add build in exceptions types

轉換內建的異常類型如 ImportError 等.

Original issue reported on code.google.com by gasolin on 11 Aug 2007 at 2:14

python 3000 compatibility

support python 3000 while it's ready

Original issue reported on code.google.com by gasolin on 3 Sep 2007 at 2:39

zhpy 1.1 文件翻译在有.ini的目录中出错

What steps will reproduce the problem?
1. In a directory without any .ini file. Prepare a test.py file.
2. zhpy --cn test.py -v
3. New a abc.ini file. No matter what content inside.
4. zhpy --cn test.py -v

Step 2 works fine. Step 4 has problems.
cnpy
file abc.ini
zhpy Exception: you may input unproper source
global name 'ConfigParser' is not defined

What version of the product are you using? On what operating system?
winxp sp2, python 2.5.1, zhpy1.1

Please provide any additional information below.
Not tested if the plugin extend dict has the same problem or not. 

Original issue reported on code.google.com by [email protected] on 10 Oct 2007 at 7:42

usage .py config define

注意到当前zhpy 的配置文件还是 .ini 格式,
建议使用原生的.py 作为配置,减少解析过程,易于扩展

Original issue reported on code.google.com by Zoom.Quiet on 10 Aug 2007 at 2:03

Multilines comments translated incorrectly

What steps will reproduce the problem?
1. foo=u"""第一行
第二行"""
2. foo被翻译错误。现象出现在文件或者交互式命令行中。


What is the expected output? What do you see instead?
不应被翻译。

What version of the product are you using? On what operating system?
winxp sp2
Python 2.5.1
pyparse 1.4.7
zhpy:0.94, 1.0 


Original issue reported on code.google.com by [email protected] on 8 Oct 2007 at 10:58

pygments syntax highlighter

provide pygments syntax highlighter for document

Original issue reported on code.google.com by gasolin on 3 Sep 2007 at 2:37

Add pyzh example test case

Add some pyzh example test cases to ensure 
the further fixes for 'python source to zhpy' function are valid.

Original issue reported on code.google.com by gasolin on 11 Oct 2007 at 5:41

GUI editor support

http://groups.google.com/group/python-cn/browse_thread/thread/4966f25deda929e1/#

Provide some level of GUI editor support

Original issue reported on code.google.com by gasolin on 3 Sep 2007 at 2:38

Add zhpy interpreter

draft zhpy interpreter implementation
http://groups.google.com/group/python-cn/browse_thread/thread/d85ad9a285998774/a
55caca591268753#a55caca591268753

{{{
zhpy.py

    os.chdir(os.getcwd())
    +# no args
    +if len(sys.argv) == 1:
    +    from zhipy import interpreter
    +    interpreter()
    +    sys.exit()
}}}

{{{
#zhipy by jiahua huang

# -*- coding: utf-8 -*-

def _indict(dic):
    '''indict({'a':'1'})  -> {'1':'a'}
    '''
    d = {}
    dick = dic.keys()
    dick.reverse()
    map(d.update, map(lambda i: {dic[i]:i}, dick))
    return d

from zhpy import *
en_cndict = _indict(cndict)
en_twdict = _indict(twdict)

"""def convertToChinese(s, l, t):
    tmp = t[0]
    if tmp in en_twdict:
        return en_twdict[tmp]
    elif re.match(r'^p_[_\d]*_v\d?$', tmp):
        tmp2 = ''
        for i in tmp.split('_'):
            if i.isdigit():
                tmp2 += unichr(int(i)).encode('utf8')
        return tmp2
    else:
        return tmp

englishChars = srange('[0-z]')
englishWord = Word(englishChars)
englishWord.setParseAction(convertToChinese)
englishWord = quotedString | englishWord"""

import code
def code4zh2en(code):
    """
    """
    for k, v in replacedict.items():
        code = code.replace(k,v)

    ucode = code.decode("utf8")
    result = chineseWord.transformString(ucode)
    result = result.encode("utf8")
    return result

class console(code.InteractiveConsole):
    """
    """
    def push(self, line):
        line = code4zh2en(line)
        self.buffer.append(line)
        source = "\n".join(self.buffer)
        more = self.runsource(source, self.filename)
        if not more:
            self.resetbuffer()
        return more

def interpreter():
    """
    zhpy interpreter
    """
    import readline, rlcompleter
    readline.parse_and_bind("tab: complete")
    con = console()
    banner = 'Python %s\nzhipy.py - An Chinese Interactive Python
shell'%(sys.version)
    con.interact(banner)
}}}


Original issue reported on code.google.com by gasolin on 24 Aug 2007 at 6:49

[TODO]提供执行打包工具

当前 zhpy 的标准使用过程是:
1. 写好中文脚本
2. 通过zhpy 生成正常脚本
3. 调用python 环境执行

都是手工执行的,不利于实用脚本的实时调试,
建议给出自动联级执行方式,
e.g:
zhpy -p my.py
就自动完成以上2~3, 实际输出的是
python my_py.py(生成后的脚本名)
的执行

Original issue reported on code.google.com by Zoom.Quiet on 10 Aug 2007 at 2:11

字符替换问题

问题描述

1. 打印 '''测试半角() 全角()句号。.'''
结果这些全角符号()。被替换成半角。

2. 文件zhdc.py的两个单引号没有替换。
# punctuations
replacedict = {
    "(":"(",
    ")":")",
    "。":".",
    """:'"',
    """:'"',
    "'":"'",
    "'":"'",
    ",":",",
    ":":":",
    "!":"!",
    }

Original issue reported on code.google.com by [email protected] on 12 Sep 2007 at 2:54

zhpy0.9.2 MissingSectionHeaderError

问题概述。
zhpy发生ConfigParser.MissingSectionHeaderError: File contains no section
headers错误。

如何重现问题。

环境
Simplified Chinese WinXP SP2, python 2.5.1, zhpy 0.9.2.
把C:\python25和C:\Python25\Scripts加入PATH环境变量。

步骤
开始,运行,cmd。在cmd窗口中启动python并输入如下指令。
{{{
import zhpy as z
z.zh_exec("打印 u'哈哈'")
}}}

Error as below
{{{
>>> import zhpy as z
>>> z.zh_exec("打印 u'哈哈'")
file ntuser.ini
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python25\lib\site-packages\zhpy-0.9.2-py2.5.egg\zhpy\zhpy.py",
line 254, in zh_exec
    annotator()
  File "c:\python25\lib\site-packages\zhpy-0.9.2-py2.5.egg\zhpy\zhpy.py",
line 141, in annotator
    ini_annotator(verbose)
  File "c:\python25\lib\site-packages\zhpy-0.9.2-py2.5.egg\zhpy\zhpy.py",
line 103, in ini_annotator
    conf.read(f)
  File "c:\python25\lib\ConfigParser.py", line 267, in read
    self._read(fp, filename)
  File "c:\python25\lib\ConfigParser.py", line 462, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: ntuser.ini, line: 1
'\xff\xfe\r\x00\n'
>>> zhpy.__version__
'0.9.2'
}}}

另外当我第一次不带任何参数运行zhpy.exe的时候也得到同样的
错误。

Original issue reported on code.google.com by [email protected] on 12 Sep 2007 at 2:05

zhpy不能搜索当前目录

What steps will reproduce the problem?
1. 在开发目录下有foo.py
2. 启动zhpy命令行
3. import foo
4. sys.path.insert(0, '')
5. import foo

What is the expected output? What do you see instead?
第三步出错

What version of the product are you using? On what operating system?
winxp sp2
python 2.5.1
zhpy 0.94, 1.0

Please provide any additional information below.
根据python教程(Python Tutorial) 6.1.1节,应当包含当前路径。


Original issue reported on code.google.com by [email protected] on 8 Oct 2007 at 11:04

alias name for if __name == "__main__"

twdict

"主程式":'if __name == "__main__"'

cndict

"主程序":'if __name == "__main__"'

Original issue reported on code.google.com by gasolin on 26 Aug 2007 at 1:21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.