[ANN]Uliweb 0.2.4 released!

2014-01-14 Thread limodou
## About Uliweb

Uliweb is a full-stacked Python based web framework. It has three main
design
goals, they are: reusability, configurability, and replaceability. All the
functionalities revolve around these goals.

This project was created and lead by Limodou mailto:limo...@gmail.com.


## License

Uliweb is released under BSD license.

## Change Log

* Fix ORM is not compatible with SQLAlchemy 0.9.1. Old style:

```
cond = None
cond = (Blog.c.id==5)  None
```

will not right in 0.9.1, because None will not be skipped, so you can
change
above code `cond = None` to :

```
from sqlalchemy.sql import true
cond = true()
```

or

```
from uliweb.orm import true
cond = true()
```

* add `__contains__` to functions, so you can test if an API is already
defined, just
  use:

```
'flash' in functions
```
* Refact generic.py, remove `functions.flash` and
`functions.get_fileserving` dependencies by default.

* Fix `yield` support in view function, you can also used in gevent
environment, for example:

```
@expose('/test')
def test():
yield ul
for i in range(10):
yield li%d/li % (i + 1)
sleep(1)
yield /ul
```

* Fix `rawsql()` bug for different database engine
* Fix `jsonp()` dumps Chinese characters bug
* Add `trim_path()` function to `utils/common.py`, it can trim a file path
to
  limited length, for example:

```
 a = '/project/apps/default/settings.ini'
 trim_path(a, 30)
'.../apps/default/settings.ini'
```

Default limited length is 30.
* Add ORM connection information output when given `-v` option in command
line. And
  the password will be replace with `'*'`. For example:

```
$uliweb syncdb -v
Connection : mysql://blog:***@localhost/blog?charset=utf8

[default] Creating [1/1, blog] blog...EXISTED
```
* Add multiple apps support for `makeapp` command, so you can use :

```
uliweb makeapp a b c
```

to create `a`, `b`, `c` apps at once time.
* Refactor `save_file()` process, add `headers` and `convertors` parameter.

`headers` used to create csv header instead of using column name, but
you can
create alias name like this:

```
User.c.username.label(uName)
```

and `convertors` used to convert column value, for example:

```
def name(value, data):

value is the column value
data is the current record object

return value + 'test'
save_file(do_(select([User.c.name])), 'test.csv',
convertors={'name':name})
```
* Fix `call_view()` invoke `wrap_result` bug. Missing pass `handler`
parameter to wrap_result.



## Features

* Project Organization

* MVT(Model View Template) development model.
* Distributed development but unified management. Uliweb organizes a
project with
small apps. Each app can have its own configuration
file(settings.ini), template
directory, and static directory. Existing apps can be easily
reused, but are treated as a compound.
web application project if configured as such. Developers can also
reference static files and templates between apps, thus easing
inter-application data exchange.
All apps in a project are loaded by default if INSTALLED_APPS is
not configured in
the configuration file. All separate app configuration files are
automatically processed at
project startup.

* URL Mapping

* Flexiable and powerful URL mapping. Uliweb uses werkzeug's routing
module.
User can easily define a URL, which in turn can be easily bound
with a view function.
URLs can also be created reversely according to the view function
name. It supports
argument definitions in URLs and default URL mapping to a
view function.

* View and Template

* View templates can be automatically applied. If you return a dict
variable from
view function, Uliweb will automatically try to match and apply a
template according
to the view function name.
* Environment execution mode. Each view function will be run in an
environment,
which eliminates the need to write many import statements. Plus
there are already many
objects that can be used directly, for example: request, response,
etc. This is DRY and saves a lot of coding
* Developers can directly use Python code in a template, the Python
code does not neede to be indented
as long as a pass statement is added at the end of each code block.
Uliweb also supports child template inclusion and inheritance.

* ORM

* Uliorm is the default ORM module but not configured by default.
Developers are free to use any
ORM module as preferred.
* Uliorm supports model creation and automatic database
migiration(table creation
and table structure modification).

* I18n

* Can be used in python and template files.
* Browser language

[ANN]Uliweb 0.2.3 released!

2014-01-05 Thread limodou
## About Uliweb

Uliweb is a full-stacked Python based web framework. It has three main
design
goals, they are: reusability, configurability, and replaceability. All the
functionalities revolve around these goals.

This project was created and lead by Limodou mailto:limo...@gmail.com.


## License

Uliweb is released under BSD license.

## Change Log

* Update nginx support output, add proxy_set_header
* Add `save_file()` function to orm, so you can save select result to a csv
file
* Add `save_file()` method to Result.
* Fix missing `clear()` function of SortedDict.
* Fix i18n process, for project and apps extraction, it'll create
application first, so that
  user defined tag will be registered correctly. But user defined tag will
be limited later.
* Add `walk_dirs()` to utils/common.py. This function can ignore some files
and file ext,
  and supports fnmatch pattern.


## Features

* Project Organization

* MVT(Model View Template) development model.
* Distributed development but unified management. Uliweb organizes a
project with
small apps. Each app can have its own configuration
file(settings.ini), template
directory, and static directory. Existing apps can be easily
reused, but are treated as a compound.
web application project if configured as such. Developers can also
reference static files and templates between apps, thus easing
inter-application data exchange.
All apps in a project are loaded by default if INSTALLED_APPS is
not configured in
the configuration file. All separate app configuration files are
automatically processed at
project startup.

* URL Mapping

* Flexiable and powerful URL mapping. Uliweb uses werkzeug's routing
module.
User can easily define a URL, which in turn can be easily bound
with a view function.
URLs can also be created reversely according to the view function
name. It supports
argument definitions in URLs and default URL mapping to a
view function.

* View and Template

* View templates can be automatically applied. If you return a dict
variable from
view function, Uliweb will automatically try to match and apply a
template according
to the view function name.
* Environment execution mode. Each view function will be run in an
environment,
which eliminates the need to write many import statements. Plus
there are already many
objects that can be used directly, for example: request, response,
etc. This is DRY and saves a lot of coding
* Developers can directly use Python code in a template, the Python
code does not neede to be indented
as long as a pass statement is added at the end of each code block.
Uliweb also supports child template inclusion and inheritance.

* ORM

* Uliorm is the default ORM module but not configured by default.
Developers are free to use any
ORM module as preferred.
* Uliorm supports model creation and automatic database
migiration(table creation
and table structure modification).

* I18n

* Can be used in python and template files.
* Browser language and cookie settings are supported including
automatic language switching.
* Provides a command line tool that developers can use to extract .po
files.
This can happen either at the app level or project level process.
It can automatically merge .pot files to existing
.po files.

* Extension

* Dispatch extension. This is a dispatch processing mechanism that
utilizes different
types of dispatch points. So you can write procedures to carry out
special processes and bind them to these dispatch points. For
example, database
initicalization, I18n process initialization, etc.
* middleware extension. It's similar to Djangos. You can configure it
in configuration
files. Each middleware can process the request and response objets.
* Special function calls in the views module initial process. If you
write a special
function named __begin__, it'll be processed before any view
function can be processed,
this allows developers to do some module level processing at that
point, for example:
check the user authentication, etc.

* Command Line Tools

* Creates project, creates apps, and include the basic essential
directory
structure, files and code.
* Export static files, you can export all available apps' static files
to a
special directory. Also supports css and js combinition and
compress process.
* Startup a development web server thats supports debugging and
autoreload.
* Apps can also have its own command line tools. For example: orm,
auth, etc.

* Deployment

* Supports mod_wsgi in Apache.
* Supports uwsgi.

* Development

* Provide a development server, and can be automatically reload when
some
module files are modified.
* Enhanced debugging, you can check the error traceback

[ANN]Uliweb 0.1.5 released!

2012-09-08 Thread limodou
https://github.com/limodou/uliweb/blob/master/CHANGELOG.md

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: https://github.com/limodou/uliweb
My Blog: http://my.oschina.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Uliweb release 0.1 version

2012-05-26 Thread limodou
On Sat, May 26, 2012 at 10:49 PM, Etienne Robillard
animelo...@gmail.com wrote:
 Flexible is more English than flexiable i guess... :-)

 Besides the typing errors I look forward in checking this out for new
 concepts...


 Cheers and congratulations,

 Etienne


Thank you. I've changed it in GIt.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: http://code.google.com/p/uliweb/
My Blog: http://hi.baidu.com/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Uliweb release 0.1 version

2012-05-25 Thread limodou
http://pypi.python.org/pypi/Uliweb/0.1

About Uliweb


Uliweb is a Python based web framework.

This project was created and lead by Limodou limo...@gmail.com.

License


Uliweb is released under BSD license.

Infrastructure


Uliweb was not created totally from scratch. It uses some modules
created by other developers, for example:

* Werkzeug Used to handle core processes in the framework. For
example: command line tools , URL Mapping, Debug, etc.
* SqlAlchemy The ORM based on it. Developers can access databases, or
use the module separately.

I also referenced some code from other web frameworks, for example:

* The Templating system is styled after the one used in web2py several
improvements were made.

I also constructed a few new wheels myself. For example:

* Form processing module. Developers can use it to create HTML code,
validate submitted data and convert submitted data to Python data
types.
* I18n processing including template support, language lazy process.
* Uliorm, which is an ORM module, was built on top of SqlAlchemy. I
also referenced from GAE datastore module.
* Framework runtime process.
* Plugin mechanism, styled after the one used in the UliPad project.

Features
---

* Organization

  * MVT(Model View Template) development model.
  * App-based project structure.

  Uliweb organizes a project with small apps. Each app can have its
own configuration file(settings.ini), template directory, and static
directory. Existing apps can be easily reused, but are treated as a
compound. web application project if configured as such.

  Developers can also reference static files and templates between
apps, thus easing inter-application data exchange. All apps in a
project are loaded by default if INSTALLED_APPS is not configured in
the configuration file. All separate app configuration files are
automatically processed at project startup.

* URL Mapping

  Flexiable and powerful URL mapping. Uliweb uses werkzeug's routing
module. User can easily define a URL, which in turn can be easily
bound with a view function. URLs can also be created reversely
according to the view function name. It supports argument definitions
in URLs and default URL mapping to a view function.

* View and Template

  View templates can be automatically applied. If you return a dict
variable from view function, Uliweb will automatically try to match
and apply a template according to the view function name. And now,
Uliweb also support Class View style. I hope you can enjoy it.

* Environment execution mode

  Each view function will be run in an environment, which eliminates
the need to write many import statements. Plus there are already many
objects that can be used directly, for example: request, response,
etc. This is DRY and saves a lot of coding

  Developers can directly use Python code in a template, the Python
code does not neede to be indented as long as a pass statement is
added at the end of each code block. Uliweb also supports child
template inclusion and inheritance.

* ORM

  Uliorm is the default ORM module but not configured by default.
Developers are free to use any ORM module as preferred. Uliorm
supports model creation and automatic database migiration(table
creation and table structure modification).

* I18n

  Can be used in python and template files. Browser language and
cookie settings are supported including automatic language switching.
Provides a command line tool that developers can use to extract .po
files. This can happen either at the app level or project level
process. It can automatically merge .pot files to existing .po files.

* Extension

  Dispatch extension. This is a dispatch processing mechanism that
utilizes different types of dispatch points. So you can write
procedures to carry out special processes and bind them to these
dispatch points. For example, database initicalization, I18n process
initialization, etc.

* Middleware extension

  It's similar to Djangos. You can configure it in configuration
files. Each middleware can process the request and response objets.

  Special function calls in the views module initial process. If you
write a special function named begin, it'll be processed before any
view function can be processed, this allows developers to do some
module level processing at that point, for example: check the user
authentication, etc.

* Command Line Tools

  * Create app, and include the basic essential directory structure,
files and code.
  * Export static files, you can export all available apps' static
files to a special directory.
  * Startup a development web server thats supports debugging and autoreload.

* Deployment

  * Supports easy deployment on the GAE platform.
  * Supports mod_wsgi, cgi, fast_cgi, scgi, uwsgi.

* Development

  Provide a development server, and can be automatically reload when
some module files are modified.

* Misc.

  Various demos are available for anyone interested

[ANN]Uliweb 0.0.1a7 release!

2011-11-14 Thread limodou
[uliweb]
download: http://uliweb.googlecode.com/files/Uliweb-0.0.1a7.zip
project: http://code.google.com/p/uliweb https://github.com/limodou/uliweb

[plugs]
also plugs is a uliweb app collection project, and you can use it
download: http://plugs.googlecode.com/files/plugs-0.0.1b2.zip
project: http://code.google.com/p/plugs/ https://github.com/limodou/plugs

About Uliweb
Uliweb is a Python based web framework.
This project was created and lead by Limodou limo...@gmail.com.
License
Uliweb is released under BSD license.
Infrastructure
Uliweb was not created totally from scratch. It uses some modules
created by other developers, for example:
* Werkzeug Used to handle core processes in the framework. For
example: command line tools , URL Mapping, Debug, etc.* SqlAlchemy The
ORM based on it. Developers can access databases, or use the module
separately.
I also referenced some code from other web frameworks, for example:
* The Templating system is styled after the one used in web2py several
improvements were made.
I also constructed a few new wheels myself. For example:
* Form processing module. Developers can use it to create HTML code,
validate submitted data and convert submitted data to Python data
types.* I18n processing including template support, language lazy
process.* Uliorm, which is an ORM module, was built on top of
SqlAlchemy. I also referenced from GAE datastore module.* Framework
runtime process.* Plugin mechanism, styled after the one used in the
UliPad project.
Features---
* Organization
  * MVT(Model View Template) development model.  * App-based project structure.
  Uliweb organizes a project with small apps. Each app can have its
own configuration file(settings.ini), template directory, and static
directory. Existing apps can be easily reused, but are treated as a
compound. web application project if configured as such.
  Developers can also reference static files and templates between
apps, thus easing inter-application data exchange. All apps in a
project are loaded by default if INSTALLED_APPS is not configured in
the configuration file. All separate app configuration files are
automatically processed at project startup.
* URL Mapping
  Flexiable and powerful URL mapping. Uliweb uses werkzeug's routing
module. User can easily define a URL, which in turn can be easily
bound with a view function. URLs can also be created reversely
according to the view function name. It supports argument definitions
in URLs and default URL mapping to a view function.    * View and
Template
  View templates can be automatically applied. If you return a dict
variable from view function, Uliweb will automatically try to match
and apply a template according to the view function name. And now,
Uliweb also support Class View style. I hope you can enjoy it.    *
Environment execution mode
  Each view function will be run in an environment, which eliminates
the need to write many import statements. Plus there are already many
objects that can be used directly, for example: request, response,
etc. This is DRY and saves a lot of coding
  Developers can directly use Python code in a template, the Python
code does not neede to be indented as long as a pass statement is
added at the end of each code block. Uliweb also supports child
template inclusion and inheritance.
* ORM
  Uliorm is the default ORM module but not configured by default.
Developers are free to use any ORM module as preferred. Uliorm
supports model creation and automatic database migiration(table
creation and table structure modification).
* I18n
  Can be used in python and template files. Browser language and
cookie settings are supported including automatic language switching.
Provides a command line tool that developers can use to extract .po
files. This can happen either at the app level or project level
process. It can automatically merge .pot files to existing .po files.
  * Extension
  Dispatch extension. This is a dispatch processing mechanism that
utilizes different types of dispatch points. So you can write
procedures to carry out special processes and bind them to these
dispatch points. For example, database initicalization, I18n process
initialization, etc.    * Middleware extension
  It's similar to Djangos. You can configure it in configuration
files. Each middleware can process the request and response objets.
Special function calls in the views module initial process. If you
write a special function named begin, it'll be processed before any
view function can be processed, this allows developers to do some
module level processing at that point, for example: check the user
authentication, etc.  * Command Line Tools
  * Create app, and include the basic essential directory structure,
files and code.  * Export static files, you can export all available
apps' static files to a special directory.  * Startup a development
web server thats supports debugging and autoreload.
* Deployment

[ANN]UliPad 4.1 released!

2011-11-06 Thread limodou
UliPad is a flexible editor, based on wxPython. It's has many
features,just like:class browser, code auto-complete, html viewer,
directory browser, wizard, etc. The main feature is the usage of
mixin. This makes UliPad can be extended easily. So you can write your
own mixin or plugin, or simple script, these can be easy and seamless
integrated with UliPad.
It's mainly bug vix version.
# Upgrade winpdb version to 1.4.8
# Improve Edit-Format-Wrap Text functionality to suit for
reStructuredText wrap
# Made memo file configurable thanks to Helio Perroni Filho
# Add Bash support thanks to Helio Perroni Filho
# Add some useful methods to support scripts files. Such as emptytab,
newtab, etc. thanks to Helio Perroni Filho
# Add Lua support thanks to zhangchunlin
# Improve python file detect according to #! /usr/bin/env python
thanks to zhangchunlin
# Add default color theme support, you can set it in Preference
# Add Create Python Package menu in context menu of Directory Browser Window
# Improve web2py plugin
# Improve regex window, and when you set Unicode flag, it'll
automatically convert u to unichr
# Fix strip tailing spaces bug
Download link: http://ulipad.googlecode.com/files/ulipad.4.1.zip
Project Address: http://code.google.com/p/ulipad
Google Group: http://groups.google.com/group/ulipad
-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: http://code.google.com/p/uliweb/
My Blog: http://hi.baidu.com/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Easiest framework to develop simple interactive web site in python?

2011-09-13 Thread limodou
On Tue, Sep 13, 2011 at 3:30 PM, John Reid j.r...@mail.cryst.bbk.ac.uk wrote:
 On 12/09/11 19:37, Stefaan Himpe wrote:

 The simplest one to learn is web2py http://www.web2py.com
 No configuration needed, just unpack and get started.
 It also has very good documentation and tons of little examples to get
 things done.

 The other options you mentioned are good too :)


 OK I've had a look at bottle, cherrypy and web2py and they look fairly
 straightforward. I'll check out some more and see where I get to. Thanks for
 the tips,
 John.


maybe you can also try out uliweb.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: http://code.google.com/p/uliweb/
My Blog: http://hi.baidu.com/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: UliPad 4.0 released!

2009-11-24 Thread limodou
 expression searching*

   You can type some regular expression on the fly, and see the result
   dynamiclly.
   -

   *Spell check plugin*

   Need to install PyEnchant module.
   -

   *Collaborative Programming*

   Multi-user can modify some files at the same time. You should enable *
   pairprog* plugin.
   -

   *Todo Supports*

   Auto finds todos and supports several kind of formats.
   -

   *Multi-View Supports*

   User can open a document in multi views, for example in left pane or
   bottom pane.
   -

   *Version Control Support*
- svn support. Now you can use svn in UliPad to update, checkout,
  commit, etc.

 Links

   - Project: http://code.google.com/p/ulipad
   - source version: http://ulipad.googlecode.com/files/ulipad.4.0.zip
   - windows exe version:
   http://ulipad.googlecode.com/files/ulipad.4.0.py25.exe
   - maillist: http://groups.google.com/group/ulipad
   - ulipad snippets site: http://ulipad.appspot.com (hosted by GAE)

Hope you enjoy it.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: http://uliwebproject.appspot.com
My Blog: http://hi.baidu.com/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: UliPad 4.0 released!

2009-11-23 Thread limodou
 expression searching*

   You can type some regular expression on the fly, and see the result
   dynamiclly.
   -

   *Spell check plugin*

   Need to install PyEnchant module.
   -

   *Collaborative Programming*

   Multi-user can modify some files at the same time. You should enable *
   pairprog* plugin.
   -

   *Todo Supports*

   Auto finds todos and supports several kind of formats.
   -

   *Multi-View Supports*

   User can open a document in multi views, for example in left pane or
   bottom pane.
   -

   *Version Control Support*
- svn support. Now you can use svn in UliPad to update, checkout,
  commit, etc.

 Links

   - Project: http://code.google.com/p/ulipad
   - source version: http://ulipad.googlecode.com/files/ulipad.4.0.zip
   - windows exe version:
   http://ulipad.googlecode.com/files/ulipad.4.0.py25.exe
   - maillist: http://groups.google.com/group/ulipad
   - ulipad snippets site: http://ulipad.appspot.com (hosted by GAE)

Hope you enjoy it.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: http://uliwebproject.appspot.com
My Blog: http://hi.baidu.com/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN]Uliweb 0.0.1a1 released!

2009-10-02 Thread limodou
=
Uliweb Introduction
=

:Author: Limodou limo...@gmail.com

.. contents::

About Uliweb


Uliweb is a relatively new Python based web framework. Before I
started to create
this framework,I had used a few other frameworks such as Karrigell, Cherrypy,
Django and web2py, but they did not satisfy my needs due to several
reasons. I then decided
to create a web framework that combined the strengths of these
frameworks, keeping in mind
that the main focus is to make Uliweb easy to use yet powerful.

This project was created and lead by Limodou limo...@gmail.com. It
is in constant development
from several other developers around the world.

License


Uliweb is released under GPL v2 license.

Infrastructure


Uliweb was not created totally from scratch. It uses some modules created by
other developers, for example:

* `Werkzeug http://werkzeug.pocoo.org/`_ Used to handle core
processes in the framework.
  For example: command line tools , URL Mapping, Debug, etc.
* `SqlAlchemy http://www.sqlalchemy.org`_ The ORM based on it.
Developers can access
  databases, or use the module separately.

I also referenced some code from other web frameworks, for example:

* The Templating system is styled after the one used in `web2py
http://mdp.cti.depaul.edu/`_ several
  improvements were made.

I also constructed a few new wheels myself. For example:

* Form processing module. Developers can use it to create HTML code,
validate submitted data and
  convert submitted data to Python data types.
* I18n processing including template support, language lazy process.
* Uliorm, which is an ORM module, was built on top of SqlAlchemy. I
also referenced from
  GAE datastore module.
* Framework runtime process.
* Plugin mechanism, styled after the one used in the `UliPad
http://code.google.com/p/ulipad`_ project.

Features
---

* Organization

  * MVT(Model View Template) development model.
  * Distributed development but unified management. Uliweb organizes a
project with
small apps. Each app can have its own configuration
file(settings.ini), template
directory, and static directory. Existing apps can be easily
reused, but are treated as a compound.
web application project if configured as such. Developers can also
reference static files and templates between apps, thus easing
inter-application data exchange.
All apps in a project are loaded by default if INSTALLED_APPS is
not configured in
the configuration file. All separate app configuration files are
automatically processed at
project startup.

* URL Mapping

  * Flexiable and powerful URL mapping. Uliweb uses werkzeug's routing module.
User can easily define a URL, which in turn can be easily bound
with a view function.
URLs can also be created reversely according to the view function
name. It supports
argument definitions in URLs and default URL mapping to a
view function.

* View and Template

  * View templates can be automatically applied. If you return a dict
variable from
view function, Uliweb will automatically try to match and apply a
template according
to the view function name.
  * Environment execution mode. Each view function will be run in an
environment,
which eliminates the need to write many import statements. Plus
there are already many
objects that can be used directly, for example: request, response,
etc. This is DRY and saves a lot of coding
  * Developers can directly use Python code in a template, the Python
code does not neede to be indented
as long as a pass statement is added at the end of each code block.
Uliweb also supports child template inclusion and inheritance.

* ORM

  * Uliorm is the default ORM module but not configured by default.
Developers are free to use any
ORM module as preferred.
  * Uliorm supports model creation and automatic database
migiration(table creation
and table structure modification).

* I18n

  * Can be used in python and template files.
  * Browser language and cookie settings are supported including
automatic language switching.
  * Provides a command line tool that developers can use to extract .po files.
This can happen either at the app level or project level process.
It can automatically merge .pot files to existing
.po files.

* Extension

  * Dispatch extension. This is a dispatch processing mechanism that
utilizes different
types of dispatch points. So you can write procedures to carry out
special processes and bind them to these dispatch points. For
example, database
initicalization, I18n process initialization, etc.
  * middleware extension. It's similar to Djangos. You can configure
it in configuration
files. Each middleware can process the request and response objets.
  * Special function calls in the views module initial process. If you
write a special
function named __begin__, it'll be processed before any view

Re: Plugin based feature adding to web-application

2009-03-13 Thread limodou
On Fri, Mar 13, 2009 at 8:31 PM, Ravi Kumar ra2...@gmail.com wrote:
 I need an architecture in a project using Django and Python + MySQL, so that
 when I put a python script in specified directory, that should be loaded and
 its methods/functions can be used.
 As far as i have thought on this, I am going to scan that particular
 directory,  list out the files, import them if they exists,

 NOw I need the functions list defined in that module. Is there any way to
 get it. I also need to find which class in defined in that python file.
 Please suggest me over architectures and best practices. Any suggestion
 would be really helpful.

 Thanks
 Rav!


When you import the plugin file, and you can use dir() to get all
attributes, and use callable() to test if the object can be invoked,
or use types.FunctionType to test if an object is a function, or you
can specified certain prefix just like: do_, etc.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: http://uliwebproject.appspot.com
My Blog: http://hi.baidu.com/limodou
--
http://mail.python.org/mailman/listinfo/python-list


[ANN]UliPad 3.9 released!

2008-04-25 Thread limodou
UliPad is a flexible editor, based on wxPython. It's has many features,just
like:class browser, code auto-complete, html viewer, directory browser, wizard,
etc. The main feature is the usage of mixin. This makes UliPad can be
extended easily. So you can write your own mixin or plugin, or simple script,
these can be easy and seamless integrated with UliPad.

New Features and Changes:

#. Add php.acp thanks for 魏振 [EMAIL PROTECTED]
#. Replace old snippet with new snippet, more details please see
`Snippet Howto howto_snippet.htm`_
#. Binding F5 to editor but not MainFrame, and add F5(Refresh) support
in Directory Browser.
#. Improve python class browser, threading update, change some icons
#. Add indent cursor move functionality see `Indent Moving Howto
howto_indent_moving.htm`_
#. Improve threading document modification process, so you can get
better efficiency
#. Introduce meide(http://code.google.com/p/meide) project to simplify
the interface creation
#. Add FNB.FNB_DROPDOWN_TABS_LIST style to EditorCtrl
#. Change auto file check in Editor on_set_focus event handler
#. Change DDE to asyncore and asynchat framework
#. Change preference dialog from notebook to treebook
#. Add icon set theme support
#. Add strip line ending when saving functionality option in Preferences
#. Strip leading space when doing Run in Shell
#. Add auto detect python interpreter in windows platform
#. Improve ReST document render, and fix the setfocus lost bug when
auto modified
   the html output, thanks a lot to ygao
#. Change setmenutext to use fix width to set the menu text, replace with '\t'
#. Chanage notebook left double click to right double click(enlarge
notebook size)
#. Add search text count in Find  Replace pane
#. Add line ending mixture check when saving file feature
#. Improve preference dialog input assistant checkbox process.
   When you check the first checkbox(Enable input assistant) it'll
   automatically toggle other 5 checkboxes.
#. Change new toolbutton to dropdown toolbutton, and it can remember the last
   new file type(select new type menu first), then when you select new menu,
   it'll create a new file with the last new file type
#. Improve command search and pairprog plugin caret display process
#. Add auto new version of UliPad check
#. Add slice language syntax support
#. Add auto pop up project setting dialog when adding directory to
directoy browser window
#. Add Open Explorer Window Here menu to editoctrl tab context menu
#. Add open snippet tool button, change open dirbrowser and open
snippet toolbutton to check toolbutton
#. Change ``explorer.exe %s`` as ``explorer.exe /e, %s`` in windows platform
#. Add copy filename to clipboard menu on document area tab context menu
#. Add wrap text feature, via [Edit]-[Format]-[Wrap Text...]

New Plugins:

#. canvas_test_plugin, you can directly test DC api
#. web2py_plugin, supply web2py shell

Bug fix:

#. Fix webopen twice open bug
#. Fix editor shortcuts key caption error
#. Fix if set DROP_DOWN_TABS_LIST style, right arrow will disappear bug
#. Fix utf-16 convertion bug
#. Fix mako tag auto complete bug #issue 14
#. Fix if lines are folded, when goto hiding lines will no effect bug
#. Fix DDE bug, thanks to LP [EMAIL PROTECTED]
#. Fix webopen bug, can't correctly deal with 'mailto:'
#. Fix smart tabs bug
#. Fix copy and paste lineending is not correct bug
#. Fix tab invisible bug after changing size or changing the page title
#. Fix template line-ending not match the default line-ending setting
#. Fix password widget is not Password type widget bug
#. Fix script filename cannot be unicode(chinese) bug
#. Fix syntax check exception process bug
#. Fix ruler bug

UliPad has ported to code.google.com, so you can visit the new project site at:
http://code.google.com/p/ulipad, and also visit the new svn address. Recommends
using source version.

source version download: http://ulipad.googlecode.com/files/ulipad.3.9.zip
window exe version: http://ulipad.googlecode.com/files/ulipad.3.9.exe

maillist: http://groups.google.com/group/ulipad
ulipad snippets site: http://ulipad.appspot.com (hosted by GAE)

Hope you enjoy it.
-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliSpot UliPad Snippets: http://ulipad.appspot.com
My Blog: http://www.donews.net/limodou
--
http://mail.python.org/mailman/listinfo/python-list


Re: Element bug?(ElementTree)

2007-12-23 Thread limodou
On Dec 23, 2007 5:30 PM, Fredrik Lundh [EMAIL PROTECTED] wrote:
 limodou wrote:

  I don't know if it's a bug? Try below code:
 
from elementtree.ElementTree import Element
a = Element('a')
if a:
   ... print ''
   ...
a.__len__()
   0
 
  You can see if I test a, the result will be False. I don't know if
  it's an expected result, but this thing has beaten me some times.

 http://effbot.org/zone/element.htm#truth-testing

 /F

Thanks. What I done just as that.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Element bug?(ElementTree)

2007-12-22 Thread limodou
I don't know if it's a bug? Try below code:

  from elementtree.ElementTree import Element
  a = Element('a')
  if a:
 ... print ''
 ...
  a.__len__()
 0

You can see if I test a, the result will be False. I don't know if
it's an expected result, but this thing has beaten me some times.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: UliPad 3.8.1 released!

2007-12-12 Thread limodou
Bug fix verion.

   1. Remove profile invoke(big mistake)
   2. Fix svn plugin checkout bug

Download:
http://ulipad.googlecode.com/files/ulipad.3.8.1.zip
http://ulipad.googlecode.com/files/ulipad.3.8.1.exe
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


Re: ANN: UliPad 3.8.1 released!

2007-12-12 Thread limodou
Please visit the site:

http://code.google.com/p/ulipad

I'm sorry forgot that.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: UliPad 3.8.1 released!

2007-12-12 Thread limodou
Bug fix verion.

   1. Remove profile invoke(big mistake)
   2. Fix svn plugin checkout bug

Download:
http://ulipad.googlecode.com/files/ulipad.3.8.1.zip
http://ulipad.googlecode.com/files/ulipad.3.8.1.exe
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: UliPad 3.8 released!

2007-12-07 Thread limodou
UliPad is a flexible editor, based on wxPython. It's has many features,just
like:class browser, code auto-complete, html viewer, directory browser, wizard,
etc. The main feature is the usage of mixin. This makes UliPad can be
extended easily. So you can write your own mixin or plugin, or simple script,
these can be easy and seamless integrated with UliPad.

What's new in 3.8
===

New Features and Changes:

#. Add mako template syntax highlight support
#. Add new option in preference, [Python]-Automatically save modified file
   when running python program, if it's checked, it'll automatically save
   the modified file.
#. Add Shift+Delete = Cut, Shift+Insert = Paste
#. Upgrade winpdb to lastest version
#. Now you can set pythonpath option in config.ini/[default],
   and ulipad will insert it into the sys.path. pythonpath can
   be a string or a string list of directory.
#. Svn support, you should install pysvn first, and also support proxy.
#. Change long line indicator default is true.
#. Add doctest support, you can run the doctest of current document in UliPad
#. Add time stamp info in debug and error file
#. Replace the shell window popup menu, and add Copy Without Prompts
   and Paste and Run menu items. And if the result cann't be convert to
   unicode, then display the result as repr().
#. Script Manager can find menu name from the script content, you
   can define it as a comment line, format is: #\s*name:(.*)$
#. Add Run in Shell menu item in Editor context menu
#. Add script and shell key binding. Change Shell to External Tool
#. Change Find in Files dialog to panel
#. Using meide module to create Preference dialog
#. Add an option to control if show the docstring in class browser window.
#. Don't create a tmp file again, directly save the file
#. Improve Find in Files process with thread
#. Add some config.ini options support in Preference Dialog
#. Refactor Find  Replace with pane, but not dialog
#. Made Open Command Here work in Linux
#. Add dropfile plugin. thanks Tyberius Prime. Now you can drop files on
   toolbar, then UliPad will open it. Just like drop files on Directory
   Browser window.
#. Add new custom lexer class and refactor related lexer process
#. Upgrade FlatNotebook.py to lastest version, thanks to swordsp
#. Improve default identifiers process, add type judgement
#. Add pylint plugin

Bug fix:

#. Fix print bug, add print line number functionality
#. Fix snippet template indent bug(when using tab mode, the '\t'
   in template will be replaced with spaces). And you can press
   Alt+Q to cancel current snippet.
#. Fix press Ctrl+B jump position is not correct bug.
#. Fix that when you change the file type, the icon in directory
   and dynamic menu don't change bug
#. Fix line number margin width, and find back End-of-line Marker menu
#. Fix adding empty directory error
#. Fix open un-exists file will popup two message dialog bug
#. Fix line end mix checking bug also including twice prompt dialog bug
#. Fix webbrowser bug. Thanks Tom Eubank
#. Fix message console postion bug, thanks for swordsp

UliPad has been ported to code.google.com, so you can visit the new
project site at: http://code.google.com/p/ulipad, and also visit the
new svn address. Recommends using source version.

Source Code: http://ulipad.googlecode.com/files/ulipad.3.8.zip
Win Execute Code: http://ulipad.googlecode.com/files/ulipad.3.8.exe

If you have any suggestion or question, please subscribe the ulipad
mailling list: http://groups.google.com/group/UliPad

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: UliPad 3.8 released!

2007-12-06 Thread limodou
UliPad is a flexible editor, based on wxPython. It's has many features,just
like:class browser, code auto-complete, html viewer, directory browser, wizard,
etc. The main feature is the usage of mixin. This makes UliPad can be
extended easily. So you can write your own mixin or plugin, or simple script,
these can be easy and seamless integrated with UliPad.

What's new in 3.8
===

New Features and Changes:

#. Add mako template syntax highlight support
#. Add new option in preference, [Python]-Automatically save modified file
   when running python program, if it's checked, it'll automatically save
   the modified file.
#. Add Shift+Delete = Cut, Shift+Insert = Paste
#. Upgrade winpdb to lastest version
#. Now you can set pythonpath option in config.ini/[default],
   and ulipad will insert it into the sys.path. pythonpath can
   be a string or a string list of directory.
#. Svn support, you should install pysvn first, and also support proxy.
#. Change long line indicator default is true.
#. Add doctest support, you can run the doctest of current document in UliPad
#. Add time stamp info in debug and error file
#. Replace the shell window popup menu, and add Copy Without Prompts
   and Paste and Run menu items. And if the result cann't be convert to
   unicode, then display the result as repr().
#. Script Manager can find menu name from the script content, you
   can define it as a comment line, format is: #\s*name:(.*)$
#. Add Run in Shell menu item in Editor context menu
#. Add script and shell key binding. Change Shell to External Tool
#. Change Find in Files dialog to panel
#. Using meide module to create Preference dialog
#. Add an option to control if show the docstring in class browser window.
#. Don't create a tmp file again, directly save the file
#. Improve Find in Files process with thread
#. Add some config.ini options support in Preference Dialog
#. Refactor Find  Replace with pane, but not dialog
#. Made Open Command Here work in Linux
#. Add dropfile plugin. thanks Tyberius Prime. Now you can drop files on
   toolbar, then UliPad will open it. Just like drop files on Directory
   Browser window.
#. Add new custom lexer class and refactor related lexer process
#. Upgrade FlatNotebook.py to lastest version, thanks to swordsp
#. Improve default identifiers process, add type judgement
#. Add pylint plugin

Bug fix:

#. Fix print bug, add print line number functionality
#. Fix snippet template indent bug(when using tab mode, the '\t'
   in template will be replaced with spaces). And you can press
   Alt+Q to cancel current snippet.
#. Fix press Ctrl+B jump position is not correct bug.
#. Fix that when you change the file type, the icon in directory
   and dynamic menu don't change bug
#. Fix line number margin width, and find back End-of-line Marker menu
#. Fix adding empty directory error
#. Fix open un-exists file will popup two message dialog bug
#. Fix line end mix checking bug also including twice prompt dialog bug
#. Fix webbrowser bug. Thanks Tom Eubank
#. Fix message console postion bug, thanks for swordsp

UliPad has been ported to code.google.com, so you can visit the new
project site at: http://code.google.com/p/ulipad, and also visit the
new svn address. Recommends using source version.

Source Code: http://ulipad.googlecode.com/files/ulipad.3.8.zip
Win Execute Code: http://ulipad.googlecode.com/files/ulipad.3.8.exe

If you have any suggestion or question, please subscribe the ulipad
mailling list: http://groups.google.com/group/UliPad

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: which configparse?

2007-12-06 Thread limodou
On Dec 6, 2007 11:49 PM, Shane Geiger [EMAIL PROTECTED] wrote:
 Best, is naturally, a somewhat subjective evaluation.  That being said,
 configparser is well regarded.  I have also seen these two options that
 you might want to check out:

 http://wiki.woodpecker.org.cn/moin/Dict4Ini
 http://www.voidspace.org.uk/python/configobj.html

Thanks for you mentioned Dict4ini, but the new project site is in
http://code.google.com/p/dict4ini

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Witch editor to use!

2007-11-30 Thread limodou
On Nov 30, 2007 5:10 PM, SMALLp [EMAIL PROTECTED] wrote:
 Hello!

 I'm new in wxPython and before i start doing anything I have one qustion.

 Shoul I use some of editors like boa, spe or shoud i use my favorite
 text editor!

 i used IDLE on windows and it seamd nice. Now i have linux installed on
 my mashine and boa works, spe wont start, IDLE crashes when compailinfg!

 And if editor is bether choice witch one to use!

Maybe you can try UliPad.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python class methods identity?

2007-11-23 Thread limodou
On Nov 23, 2007 4:06 PM, Roc Zhou [EMAIL PROTECTED] wrote:
 This is the result comes from the Linux.

 And the result from Windows is:

  class Test:
 var = 1
 def func(self): pass
  x = Test()
  y = Test()
  x.var is y.var
 True
  x.func is y.func
 False
  id(x.var)
 11228488
  id(y.var)
 11228488
  id(x.func)
 14430976
  id(y.func)
 14433656

估计只能看源码去了。不管怎么样比较变量的结果是预期的,而比较两个方法似乎是用处不大。

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: ignoring chinese characters parsing xml file

2007-10-23 Thread limodou
On 10/23/07, Fabian López [EMAIL PROTECTED] wrote:
 Hi,
 I am parsing an XML file that includes chineses characters, like
 ^�u�u啖啖才是�w.���扉L锍才是�� or ヘアアイロン... The problem is that I get an error like:
 UnicodeEncodeerror:'charmap' codec can't encode characters in position
 The thing is that I would like to ignore it and parse all the characters
 less these ones. So, could anyone help me? I suppose that I can catch an
 exception that ignores it or maybe use any function that detects this
 chinese characters and after that ignore them.

Sorry, that's not Chinese but Japanese. And I don't know which
encoding is in the source xml, because most of xml files should be
encoded in utf-8, and it'll be ok for CJK characters, and how did you
get this error?

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: ignoring chinese characters parsing xml file

2007-10-23 Thread limodou
On 10/23/07, Stefan Behnel [EMAIL PROTECTED] wrote:
 Fabian López wrote:
  Thanks Mark, the code is like this. The attrib name is the problem:
 
  from lxml import etree
 
  context = etree.iterparse(file.xml)
  for action, elem in context:
  if elem.tag == weblog:
  print action, elem.tag , elem.attrib[name],elem.attrib[url],

 The problem is the print statement. Looks like your terminal encoding (that
 Python needs to encode the unicode string to) can't handle these unicode
 characters.

I agree. For Japanese, you should know the exactly encoding name, and
convert them, just like:

print text.encoding('encoding')

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
meide wxPython UI module: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxstyledtextctrl and xml markup

2007-09-13 Thread limodou
 I highly recommend the wxPython mailing list. Right now it is down
 (see their website), but when it's back up (check their website for
 news), that's where I'd post this question if no one else here
 answers.

wxPython mail list already comes back!

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDE for Python

2007-08-21 Thread limodou
On 8/21/07, king kikapu [EMAIL PROTECTED] wrote:
 On Aug 21, 12:00 pm, Joel Andres Granados [EMAIL PROTECTED]
 wrote:
  Hello list:
 
  I have tried various times to use an IDE for python put have always been
  disapointed.


 I have also tried a lot of them (IDEs) in the last year. I was finally
 happy with Eclipse/Pydev but i was always wanted a more true IDE for
 Python.
 I think i found it in Eric4 http://www.die-offenbachs.de/eric/index.html
 You can download from here 
 http://www.riverbankcomputing.co.uk/pyqt/download.php
 (binary installer for Windows that contains Eric and PyQt)
 and have a look at it!

Maybe someone can try UliPad, I just release 3.7 version a few days before.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: UliPad 3.7 released!

2007-08-19 Thread limodou
UliPad is a flexible editor, based on wxPython. It's has many features,just
like:class browser, code auto-complete, html viewer, directory browser, wizard,
etc. The main feature is the usage of mixin. This makes UliPad can be
extended easily. So you can write your own mixin or plugin, or simple script,
these can be easy and seamless integrated with UliPad.

What's new in 3.7
===

New Features and Changes:

#. Add PEP8 sytle checking
#. Enhance calltip showing
#. Add a new option in Preference, which is used for when you toggle comment
lines(Ctrl+/ or Ctrl+\) if it'll popup a comment dialog. You can find it in
Preference-Document-Show comment character dialog when adding comment.
#. Saving auto todo window status
#. Changing shortcut of quote dialog from Ctrl+Q to Ctrl+'
#. Changing the number of recent files to 20
#. Changing shortcut Ctrl+Alt+L to Alt+Z, Ctrl+Alt+B to Alt+X
#. Saving the status of Message window word wrap
#. Saving the snippets window position
#. The results of find in files can only show the filenames and you can copy
them to clipboard
#. Add Spanish language translation and Traditional Chinese language translation
#. Using ZestyParser Module to parse the source code syntax
#. Improving input assistant functionality
#. Adding config.txt documentation
#. When saving files, automatically adding accordingly filename suffix
#. Adding mixin reload mechanism, it will be very useful when developing
#. Adding folder sort functionality when adding new folder to directory browser
window
#. Adding template in input assistant, and you can press TAB key to jump to the
next field. The template just like: ${1:something}.
#. Adding LUA syntax support
#. Adding mako(template module) support plugin
#. Adding batch filenames rename plugin
#. Enable ftp window be openned left or bottom pane according to the openning
position
#. Adding Alt+R shortcut for open recently files
#. Merging new 1.20 version winpdb to ulipad


Bug fix:

#. Fix ctag support bug
#. Fix default style bug
#. Fix the wrong cursor jumping after undo operating
#. Fix xml lexer type bug
#. Fix copying bug when the text block has no indent
#. Fix openning multi-view bug from menu items
#. Fix the input focus losing bug when openning bottom pane or double-click on
directory browser entries
#. Fix user can open multi find dialogs bug
#. Fix register functionality in windows

UliPad has been ported to code.google.com, so you can visit the new
project site at:
http://code.google.com/p/ulipad, and also visit the new svn address. Recommends
using source version.

Source Code: http://ulipad.googlecode.com/files/ulipad.3.7.zip
Win Execute Code: http://ulipad.googlecode.com/files/ulipad.3.7.exe

If you have any suggestion or question, please subscribe the ulipad
mailling list: http://groups.google.com/group/UliPad

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: UliPad 3.7 released!

2007-08-18 Thread limodou
UliPad is a flexible editor, based on wxPython. It's has many features,just
like:class browser, code auto-complete, html viewer, directory browser, wizard,
etc. The main feature is the usage of mixin. This makes UliPad can be
extended easily. So you can write your own mixin or plugin, or simple script,
these can be easy and seamless integrated with UliPad.

What's new in 3.7
===

New Features and Changes:

#. Add PEP8 sytle checking
#. Enhance calltip showing
#. Add a new option in Preference, which is used for when you toggle comment
lines(Ctrl+/ or Ctrl+\) if it'll popup a comment dialog. You can find it in
Preference-Document-Show comment character dialog when adding comment.
#. Saving auto todo window status
#. Changing shortcut of quote dialog from Ctrl+Q to Ctrl+'
#. Changing the number of recent files to 20
#. Changing shortcut Ctrl+Alt+L to Alt+Z, Ctrl+Alt+B to Alt+X
#. Saving the status of Message window word wrap
#. Saving the snippets window position
#. The results of find in files can only show the filenames and you can copy
them to clipboard
#. Add Spanish language translation and Traditional Chinese language translation
#. Using ZestyParser Module to parse the source code syntax
#. Improving input assistant functionality
#. Adding config.txt documentation
#. When saving files, automatically adding accordingly filename suffix
#. Adding mixin reload mechanism, it will be very useful when developing
#. Adding folder sort functionality when adding new folder to directory browser
window
#. Adding template in input assistant, and you can press TAB key to jump to the
next field. The template just like: ${1:something}.
#. Adding LUA syntax support
#. Adding mako(template module) support plugin
#. Adding batch filenames rename plugin
#. Enable ftp window be openned left or bottom pane according to the openning
position
#. Adding Alt+R shortcut for open recently files
#. Merging new 1.20 version winpdb to ulipad


Bug fix:

#. Fix ctag support bug
#. Fix default style bug
#. Fix the wrong cursor jumping after undo operating
#. Fix xml lexer type bug
#. Fix copying bug when the text block has no indent
#. Fix openning multi-view bug from menu items
#. Fix the input focus losing bug when openning bottom pane or double-click on
directory browser entries
#. Fix user can open multi find dialogs bug
#. Fix register functionality in windows

UliPad has been ported to code.google.com, so you can visit the new
project site at:
http://code.google.com/p/ulipad, and also visit the new svn address. Recommends
using source version.

Source Code: http://ulipad.googlecode.com/files/ulipad.3.7.zip
Win Execute Code: http://ulipad.googlecode.com/files/ulipad.3.7.exe

If you have any suggestion or question, please subscribe the ulipad
mailling list: http://groups.google.com/group/UliPad

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python editor

2007-02-07 Thread limodou
Maybe you can try ulipad.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python editor

2007-02-07 Thread limodou
On 2/8/07, Stef Mientki [EMAIL PROTECTED] wrote:
 limodou wrote:
  Maybe you can try ulipad.
 
 thanks,
 although it doesn't look bad,
 and it certainly must have been a huge job doing this with Tcl/Tk,

You are wrong, UliPad is based on wxPython, but not Tcl/Tk.

 I don't think it can compete with PyScripter,
 except on Linux ;-)

Have you try it? It has many features.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Announcement -- ZestyParser

2007-01-26 Thread limodou
On 11 Jan 2007 21:41:26 -0800, Adam Atlas [EMAIL PROTECTED] wrote:
 Thanks for the responses; you're right, and I have now posted the
 examples online. I just released version 0.6.0, by the way, which has
 several worthwhile improvements and much better documentation. It also
 includes an example for parsing RDF Notation3, to demonstrate a parsing
 task a bit more complex than the other examples.

 That's all posted at http://adamatlas.org/2006/12/ZestyParser/ now.

I'm very interesting in this project, and I see there are many
examples, but there are no input data files. So I don't know how to
test them. Can you send me some testing data files or just add them
into the tarball file, so others can easy test the examples.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: UliPad 3.6 released!

2006-12-03 Thread limodou
What's it?


It's an Editor based on wxPython. UliPad(NewEdit is the old name) uses
Mixin and Plugin technique as its architecture. Most of its classes
can be extended via mixin and plugin
components, and finally become an integrity class at
creating the instance. So UliPad is very dynamic. You can write the
new features in new files, and hardly need to modify the existing
code. And if you want to extend the existing classes, you could write
mixins and plugins, and this will be bound to the target class that I
call Slot Class. This technique will make the changes centralized
and easily managed.

What's new in 3.6
==

New features and improvement:

#. Improve definition jump, and if there is no ctag file exist, UliPad
can jump in one source file, including: variable, class, method, etc
#. Improve auto-completion: variable auto-detect, class structure
detect, base class recognize, etc. And it can improve your typing. As
you backspace something, auto-completion will also available. And you
can also write parameter datatype in function docstring, UliPad will
auto recognize the parameter datatype.
#. Add range support for live regular expression search support
#. Add pairprog plugin, it's a collaborative programming support. One
instance can be a server, and others can be client. For server, you
can share source file with all client, and both server and client can
change the same document and move the caret. UliPad support
multi-client. And it has a chatroom support, so developer can use it
to talk with each other.
#. Add fortran, and lua syntax support. For fortran you should enable
fortran plugin.
#. Improve the display structure and content of class browser
#. Add css auto-completion support

Changes:

#. Improve class browser windown, and single-click on class icon will
expand or collapse the children items
#. Fix the bug of clicking on Cancel button on Python Parameter Input
Dialog still running
#. Fix reStructuredText syntax highlight processing bug
#. Fix python syntax analysis bug
#. Fix cann't restore the last directories entries as reopen the
directory browser bug
#. Fix if the filename or directory that you want to open command line
window on it(on windows platform) is not the same hard driver, will
open wrong path bug.
#. Fix music plugin's bug
#. Remove open recently-directory functionality
#. Fix as changing the encode of the document, but the tab page title
doesn't be changed bug


Where to download it?


download lastest version 3.6:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=ulipad_3.6.zip
also have windows installer:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=UliPad.3.6.exe
wiki: http://wiki.woodpecker.org.cn/moin/UliPad
svn: http://cvs.woodpecker.org.cn/svn/woodpecker/ulipad/trunk
maillist: http://groups.google.com/group/ulipad

If you have any problem as using UliPad, welcome to join the UliPad
maillist to discuss.

Hope you enjoy it. ;-)

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: class property methods getting called only once

2006-12-03 Thread limodou
On 3 Dec 2006 21:24:03 -0800, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 In the following code, I could not find out why the set and get methods
 are not called once I set the property.


  class Test:
 ... def __init__(self):
 ... self._color = 12
 ... def _setcolor(self,value):
 ... print 'setting'
 ... self._color = value
 ... def _getcolor(self):
 ... print 'getting'
 ... return self._color
 ... color = property(_getcolor,_setcolor)
 ...
  a = Test()
  a.color
 getting
 12
  a.color = 22
  a.color
 22

 For some reason the set method is not getting called at all, Anybody
 has any clue?

 thanks.

property can only be used in New Style Class. So you should write your Test as:

class Test(object):

And try again.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to Split Chinese Character with backslash representation?

2006-10-27 Thread limodou
On 10/27/06, Cameron Walsh [EMAIL PROTECTED] wrote:
 limodou wrote:
  On 10/27/06, Wijaya Edward [EMAIL PROTECTED] wrote:
 
  Thanks but my intention is to strictly use regex.
  Since there are separator I need to include as delimiter
  Especially for the case like this:
 
   str = '\xc5\xeb\xc7\xd5\xbc--FOO--BAR'
   field = list(str)
   print field
  ['\xc5', '\xeb', '\xc7', '\xd5', '\xbc', '-', '-', 'F', 'O', 'O', '-',
  '-', 'B', 'A', 'R']
 
  What we want as the output is this instead:
  ['\xc5', '\xeb', '\xc7', '\xd5', '\xbc','FOO','BAR]
 
  What's the best way to do it?
 
  If the case is very simple, why not just replace '_' with '', for example:
 
  str.replace('-', '')
 
 Except he appears to want the Chinese characters as elements of the
 list, and English words as elements of the list.  Note carefully the
 last two elements in his desired list.  I'm still puzzling this one...

Oh, I see. I made a mistake.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Fwd: How to Split Chinese Character with backslash representation?

2006-10-26 Thread limodou
-- Forwarded message --
From: limodou [EMAIL PROTECTED]
Date: Oct 27, 2006 11:51 AM
Subject: Re: How to Split Chinese Character with backslash representation?
To: Wijaya Edward [EMAIL PROTECTED]


On 10/27/06, Wijaya Edward [EMAIL PROTECTED] wrote:

 Hi all,

 I was trying to split a string that
 represent chinese characters below:


  str = '\xc5\xeb\xc7\xd5\xbc'
  print str2,
 ???
  fields2 = split(r'\\',str)
  print fields2,
 ['\xc5\xeb\xc7\xd5\xbc']

 But why the split function here doesn't seem
 to do the job for obtaining the desired result:

 ['\xc5','\xeb','\xc7','\xd5','\xbc']

\xXX just internal representation of None ASCII, I guess above string
is encoded with local locale, maybe gbk. You can get the bytes list
through:

str = '\xc5\xeb\xc7\xd5\xbc'
list(str)

And string is just a list of characters.

--
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou


-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to Split Chinese Character with backslash representation?

2006-10-26 Thread limodou
On 10/27/06, Wijaya Edward [EMAIL PROTECTED] wrote:

 Thanks but my intention is to strictly use regex.
 Since there are separator I need to include as delimiter
 Especially for the case like this:

  str = '\xc5\xeb\xc7\xd5\xbc--FOO--BAR'
  field = list(str)
  print field
 ['\xc5', '\xeb', '\xc7', '\xd5', '\xbc', '-', '-', 'F', 'O', 'O', '-', '-', 
 'B', 'A', 'R']

 What we want as the output is this instead:
 ['\xc5', '\xeb', '\xc7', '\xd5', '\xbc','FOO','BAR]

 What's the best way to do it?

If the case is very simple, why not just replace '_' with '', for example:

str.replace('-', '')

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's the best IDE?

2006-10-25 Thread limodou
On 25 Oct 2006 17:20:32 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 After researching Komodo, I found it's not free. The only funds I have
 are a college fund, and I can't start diping into that until I'm going
 to college. Any free AND good IDEs?

I think most of wxPython IDE are good. I prefer UliPad, because I'm
the author of it, you can find the link from my signature. It's cross
platform, and many features. It has not embed debuger in it now, so
you can use winpdb to debug your program. It support auco-complete in
editing and also provide a shell window also support auto-complete.
And the auco-complete in editing is more powerful.

Other good wxPython IDE should be SPE, drPython, PyPE, etc.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN]UliPad 3.5 released

2006-10-24 Thread limodou
What's it?


It's an Editor based on wxPython. NewEdit is the old name, and UliPad
is the new name. UliPad uses Mixin and Plugin technique as its
architecture. Most of its classes can be extended via mixin and plugin
components, and finally become an integrity class at
creating the instance. So UliPad is very dynamic. You can write the
new features in new files, and hardly need to modify the existing
code. And if you want to extend the existing classes, you could write
mixins and plugins, and this will be bound to the target class that I
call Slot Class. This technique will make the changes centralized
and easily managed.

What's new in 3.5
==

New features and improvement:

#. Add not automatically clear content of Message window, and add
Shift+F5 shortcut
#. Use FlatNotebook instead of Notebook
#. Add spell checking plugin, and you should install pyEnchant module
#. Auto save side pane size
#. Auto maximize when double-click on tab of notebook, only 50% for side pane
#. Improve acp format, and you can use {#text#} represent selected text
#. Add support for creating ePyDoc comment to function definition
#. Add personal info management, only user name for now
#. Add session management
#. Add live regular expression searching, you can type regex
dynamically and watch the result immediately
#. Add CloseOther plugin, thanks for nmweizi, and it can keep current
document but close all others documents
#. Add smart navigation, and it can remember the path of files visited
#. Improve Ctrl+B to jump to last modified position
#. Add a checkbox for reStructuredText Html view window, and it can
used for stop automatically refresh the html content as you changing
the ReST file
#. Auto close syntax check window as there are no errors to current python file
#. Auto support for dropping files and directories to directory window
#. Dynamically popup menu creation of notebook
#. Add open Dos window here for current document on popup menu of
notebook, only works for windows now
#. Add custom FlatButtons control written by myself, used in smart navigation
#. Improve support for custom toolbar control in toolbar process
#. Improve project process: refactor, adding and deleting config process
#. Improve Chinese support in rerange.py script

Changes:

#. Remove the process for input assistant in OnKeyDown of editor, in
order to simplify the process
#. Fix don't check the syntax for python file as saving bug
#. Fix can't search for document as opening it bug
#. Fix incorrect enabled status for toolbar buttons bug
#. Fix incorrect syntax highlight process bug
#. Refactor and fix New... menuitem is not the same with toolbar menu bug
#. Fix losing input focus after saving file bug
#. Fix pressing Ctrl+F4 will quit UliPad bug
#. Change recent files and recent path menu to popup menu, so it will
speed opening file and saving file
#. Fix the redirection process of executing python program, and add an
option for showing parameter window on every running
#. Fix the efficient of input assistant bug
#. Change Ctrl+Enter to Shift+Enter

Where to download it?


download lastest version 3.5:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=ulipad_3.5.zip
also have windows installer:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=UliPad.3.5.exe
wiki: http://wiki.woodpecker.org.cn/moin/UliPad
svn: http://cvs.woodpecker.org.cn/svn/woodpecker/ulipad/trunk
maillist: http://groups.google.com/group/ulipad

If you have any problem as using UliPad, welcome to join the UliPad
maillist to discuss.

Hope you enjoy it. ;-)

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


[ANN]UliPad 3.5 released

2006-10-23 Thread limodou
What's it?


It's an Editor based on wxPython. NewEdit is the old name, and UliPad
is the new name. UliPad uses Mixin and Plugin technique as its
architecture. Most of its classes can be extended via mixin and plugin
components, and finally become an integrity class at
creating the instance. So UliPad is very dynamic. You can write the
new features in new files, and hardly need to modify the existing
code. And if you want to extend the existing classes, you could write
mixins and plugins, and this will be bound to the target class that I
call Slot Class. This technique will make the changes centralized
and easily managed.

What's new in 3.5
==

New features and improvement:

#. Add not automatically clear content of Message window, and add
Shift+F5 shortcut
#. Use FlatNotebook instead of Notebook
#. Add spell checking plugin, and you should install pyEnchant module
#. Auto save side pane size
#. Auto maximize when double-click on tab of notebook, only 50% for side pane
#. Improve acp format, and you can use {#text#} represent selected text
#. Add support for creating ePyDoc comment to function definition
#. Add personal info management, only user name for now
#. Add session management
#. Add live regular expression searching, you can type regex
dynamically and watch the result immediately
#. Add CloseOther plugin, thanks for nmweizi, and it can keep current
document but close all others documents
#. Add smart navigation, and it can remember the path of files visited
#. Improve Ctrl+B to jump to last modified position
#. Add a checkbox for reStructuredText Html view window, and it can
used for stop automatically refresh the html content as you changing
the ReST file
#. Auto close syntax check window as there are no errors to current python file
#. Auto support for dropping files and directories to directory window
#. Dynamically popup menu creation of notebook
#. Add open Dos window here for current document on popup menu of
notebook, only works for windows now
#. Add custom FlatButtons control written by myself, used in smart navigation
#. Improve support for custom toolbar control in toolbar process
#. Improve project process: refactor, adding and deleting config process
#. Improve Chinese support in rerange.py script

Changes:

#. Remove the process for input assistant in OnKeyDown of editor, in
order to simplify the process
#. Fix don't check the syntax for python file as saving bug
#. Fix can't search for document as opening it bug
#. Fix incorrect enabled status for toolbar buttons bug
#. Fix incorrect syntax highlight process bug
#. Refactor and fix New... menuitem is not the same with toolbar menu bug
#. Fix losing input focus after saving file bug
#. Fix pressing Ctrl+F4 will quit UliPad bug
#. Change recent files and recent path menu to popup menu, so it will
speed opening file and saving file
#. Fix the redirection process of executing python program, and add an
option for showing parameter window on every running
#. Fix the efficient of input assistant bug
#. Change Ctrl+Enter to Shift+Enter

Where to download it?


download lastest version 3.5:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=ulipad_3.5.zip
also have windows installer:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=UliPad.3.5.exe
wiki: http://wiki.woodpecker.org.cn/moin/UliPad
svn: http://cvs.woodpecker.org.cn/svn/woodpecker/ulipad/trunk
maillist: http://groups.google.com/group/ulipad

If you have any problem as using UliPad, welcome to join the UliPad
maillist to discuss.

Hope you enjoy it. ;-)

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Best IDE?

2006-10-17 Thread limodou
On 10/14/06, Fulvio [EMAIL PROTECTED] wrote:
 ***
 Your mail has been scanned by InterScan MSS.
 ***


 On Friday 13 October 2006 23:17, limodou wrote:
  hope you try it.

 If you'll manage for macro recording, playing back and from file then I'll be
 yours :)

 F

I'll add this funcationality at 3.6 version. And I want to release 3.5
as soon as I can.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to paras such echo string effection?

2006-10-17 Thread limodou
On 10/17/06, Kevien Lee [EMAIL PROTECTED] wrote:
 Hi everyone,

 When i decide to paras a string,which return from running a CVS command,it's
 amaze that i want to get some file of the echo string ,how to make paras
 process more effect?

 the problem detail as follow that:

 run command:cvs  status -r it will return all the file list in as follow?



 ===
 File: file01.xls Status: Up-to-date

Working revision: 1.1
Repository revision: 1.1 /msg/file01.xls,v
Sticky Tag:  (none)
Sticky Date:  (none)
Sticky Options: -kb

 cvs status: Examining 20060815
 ===
 File: file02.xls Status: Up-to-date

Working revision: 1.1
Repository revision:/msg/file02.xls ,v
Sticky Tag:  (none)
Sticky Date:  (none)
Sticky Options: -kb

 cvs status: Examining 20060816
 ===


 Now ,i just what to know the file of Status,if paras all should be

 coast expenses,is there any effect way?

 PS:is there any python lib for CVS ?


I think you can use regular expression to match the Status. Or simple
find 'File' and 'Status' substring, and get the result.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Best IDE?

2006-10-13 Thread limodou
On 10/13/06, Theerasak Photha [EMAIL PROTECTED] wrote:
 On 13 Oct 2006 07:37:07 -0700, Bernard [EMAIL PROTECTED] wrote:
  IDE : SPE (Stani's python editor) : http://stani.be/python/spe/blog/
  Why?: because this IDE is not complicated. it ships with a debugger, a
  gui designer, a source code checker and a regex console.
  Like: obviously everything
  Hate: sometimes it doesn't start on windows 2000
  Platform: Windows, Linux, Mac
  cost: free but I'll donate some money because I like it

 Will definitely give it a look.

Maybe you could also check out UliPad to try it. Many features UliPad
also have, and it also shipped with

* directory browser
* multi-view
* multi-language highlight support, like: python, javascript, css, html, etc
* simple project support bind with directory browser
* commands searching
* live regular expression searching, type regex, and you'll see the
result immediately
* session manager
* i18n
* input assistant, support call tips, '.' hint, and auto-complete, for
example: you type

  def then it'll expand to def ():
* many plugins, for example spell check, if you install pyenchant module
* others things

hope you try it.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN:UliPad 3.4 Release

2006-10-11 Thread limodou
 can find them at UliPad/scripts directory

* Wizard

* You can make your own wizard template. The wizard can input user
data, combine with template, and output the result. And wizard also
support code framework created. This feature will help you improving
coding efficiency.

* Direcotry Browser

* Browse multiple directories, and you can really add, delete,
rename directories and files. Double click will open the file in
Editor window.

* Input Assistant

* Suport user autocomplete file, it can help to input code very
helpful and functional. Just like EditPlus, but may be more powerful.

* Column Editing Mode

* You can select multilines, and then set a column mode region, so
in any line of this region, if you enter a character, other lines will
also add this character. If you want to deal with multilines as a
similar mode, this functionality will be very handy.

Hope fun!

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN:UliPad 3.4 Release

2006-10-09 Thread limodou
 can find them at UliPad/scripts directory

* Wizard

* You can make your own wizard template. The wizard can input user
data, combine with template, and output the result. And wizard also
support code framework created. This feature will help you improving
coding efficiency.

* Direcotry Browser

* Browse multiple directories, and you can really add, delete,
rename directories and files. Double click will open the file in
Editor window.

* Input Assistant

* Suport user autocomplete file, it can help to input code very
helpful and functional. Just like EditPlus, but may be more powerful.

* Column Editing Mode

* You can select multilines, and then set a column mode region, so
in any line of this region, if you enter a character, other lines will
also add this character. If you want to deal with multilines as a
similar mode, this functionality will be very handy.

Hope fun!

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


Re: ANN:UliPad 3.4 Release

2006-10-09 Thread limodou
Sorry for the url

download lastest version 3.4:
 
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=ulipad_3.4.zip
 also have windows installer:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=UliPad.3.4.exe

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN:UliPad 3.4 Release

2006-10-09 Thread limodou
 can find them at UliPad/scripts directory

* Wizard

* You can make your own wizard template. The wizard can input user
data, combine with template, and output the result. And wizard also
support code framework created. This feature will help you improving
coding efficiency.

* Direcotry Browser

* Browse multiple directories, and you can really add, delete,
rename directories and files. Double click will open the file in
Editor window.

* Input Assistant

* Suport user autocomplete file, it can help to input code very
helpful and functional. Just like EditPlus, but may be more powerful.

* Column Editing Mode

* You can select multilines, and then set a column mode region, so
in any line of this region, if you enter a character, other lines will
also add this character. If you want to deal with multilines as a
similar mode, this functionality will be very handy.

Hope fun!

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN:UliPad 3.4 Release

2006-10-09 Thread limodou
Sorry for the url

download lastest version 3.4:
 
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=ulipad_3.4.zip
 also have windows installer:
http://wiki.woodpecker.org.cn/moin/UliPad?action=AttachFiledo=gettarget=UliPad.3.4.exe

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: dictionary of list from a file

2006-10-04 Thread limodou
On 4 Oct 2006 06:09:21 -0700, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi guys,
 this is my first post. my programming background is perlish scripting
 and now I am learning python. I need to create a dictionary of list
 from a file. Normally in perl I use to do like:

 while(IN){
   @info=split(/ +/,$_);
   push (@{$tmp{$info[0]}},$info[1]);
 }

 and then
 foreach $key (keys %tmp){
print $key - @{$tmp{$key}}\n;
 }
 i get

 2 - 1  2 3 4
 7 - 7 8 9 10

 in python I tried:
 b={}
 a=[]
 for line in fl.readlines():
  info=lines.split()
  b[info[0]] = a.append(info[1])

 and then
 for i in b:
  print i,b[i]
 i get
 2 None
 7 None

 data file is:
 2 1
 2 2
 2 3
 2 4
 7 7
 7 8
 7 9
 7 10

 Any help??
 Thanks in advance
 Best Regards

 Andrea

here is my program

d = {}
for line in file('test.txt'):
line = line.strip()
if line:
k, v = line.strip().split()
d.setdefault(k, []).append(v)
print d

Dict in Python has a setdefault method, if there is a key in dict,
it'll return the value, and if there is not a key existed, it'll
insert a key with the value supplied by the second parameter and
return the value. So using setdefault will be very handy for inserting
key.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: dictionary of list from a file

2006-10-04 Thread limodou
On 4 Oct 2006 13:11:15 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 limodou wrote:
  here is my program
 
  d = {}
  for line in file('test.txt'):
  line = line.strip()
  if line:
  k, v = line.strip().split()
  d.setdefault(k, []).append(v)
  print d

 Minor nits: you call strip twice, when you don't need to.  just omit
 the second call.

Yes, I forgot that.

 Also, I'm not sure stripping the line is the right thing per the spec;

 d = {}
 for line in [l[:-1] for l in file('test.txt', 'rU') if len(l)1]:
 k,v = line.split()
 d.setdefault(k,[]).append(v)

[l[:-1] for l in file('test.txt', 'rU') if len(l)1]

this line I think will create a list, and if the file is large, it'll
consume many memory I think.

And I think using strip is more clear than list comprehension, except
for the memory consume.

-- 
I like python!
UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for the Perfect Editor

2006-09-14 Thread limodou
On 9/14/06, Franz Steinhaeusler [EMAIL PROTECTED] wrote:
 On 7 Sep 2006 13:18:22 -0700, Omar [EMAIL PROTECTED]
 wrote:

 I'd love the perfect editor that would be:
 
 a) free

 DrPython and spe; both written in Python and wxPython using SciTe's
 control scintilla) and SciTE.

 DrPython on:
 http://sourceforge.net/projects/drpython/ (Projectpage)
 http://drpython.sourceforge.net/ (Homepage)

 
 b) enable me to drag and drop code snippets from a sort of browser into
 the code

 DrPython Codemarks plugin.

 
 c) can run programs right from within

 DrPython = Program = Run (default F5)

 
 d) can edit
   - PYTHON
 DrPython, spe, SciTE.

   - Javascript
 no definite support.

   - HTML
 DrPython (the others, I don't know)

   - actionscript (since I'm also learning flash)

 Sepy on Sourceforge (also written in Python with wxPython)
 http://sourceforge.net/projects/sepy/

 
 e) easy to learn
 

 SciTE especially.

 suggestions?

These things UliPad also can do. And it also support html, javascript,
css, java, etc syntax highlight. UliPad also support Input Assistant,
even include custom calltips and auto-complete, and many features, you
can find in http://wiki.woodpecker.org.cn/moin/UliPad

It also has a directory browser, wizard, plugins-system, code snippets
manage. Just using it, you'll find out what it's.


-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for the Perfect Editor

2006-09-14 Thread limodou
On 9/15/06, Roger [EMAIL PROTECTED] wrote:
 Jay wrote:
  I, too, am a hardcore fan of jEdit.  It's nice to finally see some user
  support on this forum.  :-)


 The biggest problem I have with anything written in Java is the long
 startup time.  The editor may be great but the platform is mediocre.

 I am a SciTE bigot.  I have recently tried SPE and UliPad.  UliPad would
 be my second choice and is still installed, but SPE was quickly removed.
   One feature I like about SciTE is being able to position the cursor
 anywhere on a word and hit CTL-F to find the NEXT occurrence.

 With UliPad, you have to select the entire word you want to search for,
 and then when you hit CTL-F -- it first finds the same occurrence you
 selected -- you have to hit F3 to find the next.

No, in UliPad you can first select the word(double-click the word),
then press F4 to locate the next position.

And if you install the newest source version of UliPad, it also
suplied an enhanced Input Assistant feature, as type some character in
blank place, it'll popup a list which will match what you type,
including identifiers, class names, function names, parameters names,
etc. And there is also a vim-like shortkey, Ctrl+P, Ctrl+Shift+P,
Ctrl+L, Ctrl+Shift+L(which are in Duplicate menu), they'll match the
word backward or forward to
current position, you can try it.
 I think SciTE is better engineered.  Still, much of your choice is
 personal preference.  I have noticed that any two people using the same
 editor will use different keystroke and mouse sequences when presented
 with similar editing problems.

 Good discussion - I thank the originator of the thread.

 Roger



 --
 http://mail.python.org/mailman/listinfo/python-list



-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode characters

2006-09-04 Thread limodou
On 9/4/06, Paul Johnston [EMAIL PROTECTED] wrote:
 Hi
 I have a string which I convert into a list then read through it
 printing its glyph and numeric representation

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

 thestring = abcd
 thelist = list(thestring)

 for c in thelist:
  print c,
  print ord(c)

 Works fine for latin characters but when I put in a unicode character
 a two byte character gives me two characters. For example an arabic
 alef returns

 *  216
 * 167

 ( the first asterix is the empty set symbol the second a double s)

 Putting in sequential characters i.e. alef, beh, teh mabuta, gives me
 sequential listings i.e.
 216  167
 216  168
 216  169
 So it is reading the correct details.


 Is there anyway to get the c in the for loop to recognise it is
 reading a multiple byte character.
 I have followed the info in PEP 0263 and am using Python 2.4.3 Build
 12 on a Windows box  within Eclipse 3.2.0 and Python plugins 1.2.2

If the string is not a unicode, it's be encoded in byte, so you can
only get the every character encoding of the string. You can conver it
to unicode, and if the character value less than 127, it should be an
ascii, otherwise maybe a multibytes character. for example:

a = 'string'
b = unicode(a, encoding_according_your_situation)
for i in b:
   if ord(i)  127:
   print ord(i), 'ascii'
   else:
   print ord(i), 'multibytes'

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python newbie with a problem writing files

2006-09-04 Thread limodou
On 4 Sep 2006 08:16:24 -0700, Jason [EMAIL PROTECTED] wrote:
 limodou wrote:
   Code:
  
   import feedparser
   from xml.sax import saxutils
  
   feed_number=200
  
   feed_list = open(feed_listing.conf,r)
   for each_feed in feed_list:
   data=feedparser.parse(each_feed)
   feed_title=data.entries[0].title
   xml_output=open(xml_data\\feed + str(feed_number) + .xml, w)
 
  Maybe there is a extra '=', if it should be:
 
  xml_output.write(feed_title)
 
  ?
 

 It took me a few moments to parse what limodou wrote here, but he's
 absolutely correct.  Your problem is that you are trying to reassign
 the write method in your file.  File objects are built-in types, and do
 not allow their methods to be calvaliery replaced.

 Here's an example on the correct way (and your way) of writing to a
 file:
  f = open('spam.xml', 'w')
  f.write( 'This data is written to the file' )
  f.write = (This is not a valid Python syntax)
 Traceback (most recent call last):
   File stdin, line 1, in ?
 AttributeError: 'file' object attribute 'write' is read-only
 

 You'll notice that the AttributeError describes exactly what's wrong in
 this case.  The write method on your file attribute is read-only.  It
 doesn't say anything about whether your file is read-only.

 If you really, really want to change the write method into a string,
 you can subclass from the file class:

  class MyFileType(file):
 ... pass
 ...
  myfile = MyFileType('spam_and_eggs.xml', 'w')
  myfile.write
 built-in method write of MyFileType object at 0x00870B88
  myfile.write = Gonna replace write method with this string!
  myfile.write
 'Gonna replace write method with this string!'
 

 Of course, you can no longer easily access the original write method
 after re-assigning it like that.

 (limodou, I thought this might need a little bit of extra explanation
 for the original poster.  I apologize if I seem rude here.)

Very good, I just want to point out the bug according to the
traceback, and don't think so much. But you explained so details.

:)

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to get a filename's extension

2006-09-03 Thread limodou
On 3 Sep 2006 17:46:32 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hello all,

 I am new to python and I am having some difficulty obtaining the
 extension of a file. I was looking at the re.match module but I am
 completely overwhelmed by regular expressions. Is there an easier way
 to get the extension for a file name like:

 this.is.my.file.avi

 I would just like to pull out the 'avi'

 your help is greatly appreciated! :)

 import os
 os.path.splitext('this.is.my.file.avi')
('this.is.my.file', '.avi')

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python newbie with a problem writing files

2006-09-03 Thread limodou
On 9/4/06, John Jones [EMAIL PROTECTED] wrote:
 Hi All,

 I have been driven insane by this error. I have this small program, shown 
 below, which runs great until it gets to writing the data out to the file. I 
 am running an install of Python 2.4. Yes, feedparser is functioning fine (I 
 put in print feed_title statements as tests - but have since removed them). I 
 am missing something obvious.

 Thanks
 JJ

 Code:

 import feedparser
 from xml.sax import saxutils

 feed_number=200

 feed_list = open(feed_listing.conf,r)
 for each_feed in feed_list:
 data=feedparser.parse(each_feed)
 feed_title=data.entries[0].title
 xml_output=open(xml_data\\feed + str(feed_number) + .xml, w)
 xml_output.write = (feed_title)

Maybe there is a extra '=', if it should be:

xml_output.write(feed_title)

?

 xml_output.close()
 feed_number+=1

 Error Message:

 Traceback (most recent call last):
   File C:/My_Blogroll/JJ_Blogroll2, line 11, in ?
 xml_output.write = (feed_title)
 AttributeError: 'file' object attribute 'write' is read-only


-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
-- 
http://mail.python.org/mailman/listinfo/python-list



[ANN]UliPad 3.3 is released

2006-08-24 Thread limodou
 Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN]UliPad 3.3 is released

2006-08-23 Thread limodou
 Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


[ANN]UliPad 3.3 is released

2006-08-23 Thread limodou
 Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A Editor Feature for Extending Selection based on Language Syntax

2006-08-20 Thread limodou
On 20 Aug 2006 21:49:45 -0700, Xah Lee [EMAIL PROTECTED] wrote:
 can anyone give me a guide about writing a short elisp function? (for
 non-emacs readers, this message will describe a editor feature i think
 will be very beneficial to spread this concept.)

 i want to write a function such that, when run, highlight a region
 between the nearest left and right delimiters. Delimiters are any of
 parenthesis, square brackets, or single and double quotes etc. When the
 function is run again, it extends the selection to the next enclosing
 delimiters.

 So, in this way, a user can repeatedly press a keyboard shortcut and
 extend the selection.

This functionality can be found in NewEdit
(http://wiki.woodpecker.org.cn/moin/NewEdit), first put the caret in
middle of delimeters, such as ''(){}[], then press Ctrl+E, the text
between delimeters will be selected. And there are two direction of
selection, left first and right first(Ctrl+Shift+E). If you press
Ctrl+Alt+E again, the the delimeters will be selected.

 This is feature of BBEdit/TextWrangler on the Mac, which extend
 selection to the nearest outer parenthesis. This is also a feature of
 the Mathematica editor, which actually extend selection to the nearest
 syntactical unit in the language, not just paired delimiters.

 What i wanted this for is mostly in editing HTML/XML, where one press
 can select the content, another press will include the enclosing tags,
 another press extends the selection to the next outer content, and
 another press include that tags too, and so on.

NewEdit can not support this feature now.


-- 
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ReStructuredText

2006-08-15 Thread limodou
 Yeah, right after you asked, I tried 0.4, but it failed with a
 traceback.

But my version works good.

 I ended up installing 0.3.9 and it works fine (and didn't
 require the list to be indented either, FWIW).

Yeah.

 For anyone who cares, the traceback with 0.4 was:

 Python 2.4.2 (#1, Feb 13 2006, 15:24:20)
 [GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2
 Type help, copyright, credits or license for more information.
  from docutils.core import publish_parts
 Traceback (most recent call last):
   File stdin, line 1, in ?
   File /usr/lib/python2.4/site-packages/docutils/core.py, line 23,
 in ?
 from docutils import frontend, io, utils, readers, writers
   File /usr/lib/python2.4/site-packages/docutils/readers/__init__.py,
 line 15, in ?
 from docutils.transforms import universal
   File
 /usr/lib/python2.4/site-packages/docutils/transforms/__init__.py, line
 69, in ?
 class Transformer(TransformSpec):
   File
 /usr/lib/python2.4/site-packages/docutils/transforms/__init__.py, line
 78, in Transformer
 default_transforms = (universal.Decorations,
 AttributeError: 'module' object has no attribute 'FinalChecks'



-- 
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: dynamic construction of variables / function names

2006-03-29 Thread limodou
On 29 Mar 2006 22:44:24 -0800, Sakcee [EMAIL PROTECTED] wrote:
 python provides a great way of dynamically creating fuctions calls and
 class names from string

 a function/class name can be stored as string and called/initilzed

 e.g

 def foo(a,b):
 return a+b

 def blah(c,d):
 return c*d


 list = [foo, blah]

 for func in list:
 print func(2,4)

 or similar items


 what is the way if the names of functions are some modification e.g

 def Newfoo(a,b):
 return a+b

 def Newblah(c,d):
 return c*d

 list = [foo, blah]

 for func in list:
 print New+func(2,4)

 or define a variable

 New+list[0] = First Funciton


 I think ,   print New+func(2,4)  and New+list[0] = First
 Funciton

 will not work,  either eval or exec should be used
 is it correct way, is there a simple way, is this techniqe has a name?

 thanks


You could get the function object from globals(), for example:

for func in list:
   f = globals().get(New+func, None)
   if f and callable(f):
print f(2, 4)

--
I like python!
My Blog: http://www.donews.net/limodou
My Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py web-app-frameworks without a rdbms...

2006-03-21 Thread limodou
On 21 Mar 2006 17:06:12 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi folks,

 Of TurboGers  Django WAF candidates, which one would be easier to use
 in an environment where the data/content doesn't come an RDBMS, but
 from other server-side apps... If these are not good candidates, could
 you suggest appropriate ones...

 TIA,
 /venkat

If you don't want to use RDBMS, I think Karrigell is better. Many
features of Django and TurboGears relate to database.

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to run shell commands within python

2006-02-15 Thread limodou
On 15 Feb 2006 23:21:09 -0800, fileexit [EMAIL PROTECTED] wrote:
 How can I execute shell commands from within python.  Specifically, I
 am looking for something like the shell cat.  But this also made me
 wonder how to execute shell commands anyway, just if i needed to do
 that in the future.


You can use os.system() or os.popen(), etc.


--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: read-only attributes

2006-02-09 Thread limodou
On 2/10/06, john peter [EMAIL PROTECTED] wrote:
 while reading the lib manual, i came across mentions of read-only
 attributes.
  for example, a method has a read-only attribute (called _im_self ?) for
 binding
  a class instance to the method. is such a facility available to custom
 application
  code? if so, what do i have to do if i want my application code to have
 read-only
  attributes?



I think you may consider property() built-in function:

property( [fget[, fset[, fdel[, doc)

Return a property attribute for new-style classes (classes that derive
from object).
fget is a function for getting an attribute value, likewise fset is a
function for setting, and fdel a function for del'ing, an attribute.
Typical use is to define a managed attribute x:


class C(object):
def __init__(self): self.__x = None
def getx(self): return self.__x
def setx(self, value): self.__x = value
def delx(self): del self.__x
x = property(getx, setx, delx, I'm the 'x' property.)

New in version 2.2.

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module with __call__ defined is not callable?

2006-02-07 Thread limodou
On 2/8/06, adam johnson [EMAIL PROTECTED] wrote:
 Hi All.
 I was wondering why defining a __call__ attribute for a module doesn't make
 it actually callable.

 I don't have any reason for doing so, I was just wondering if it worked, and
 found out it didn't.

 $ cat mod.py
 
 Test callable module
 
 def __call__():
 return in mod.__call__


  import mod
  mod()
 Traceback (most recent call last):
   File stdin, line 1, in ?
 TypeError: 'module' object is not callable
  mod.__call__()
 'in mod.__call__'


 Thanks for any replies, Adam.



I remebered that __call__() is just used for class, but not module. Am I wrong?

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module with __call__ defined is not callable?

2006-02-07 Thread limodou
On 2/8/06, Delaney, Timothy (Tim) [EMAIL PROTECTED] wrote:
 adam johnson wrote:

  Hi All.
  I was wondering why defining a __call__ attribute for a module
  doesn't make it actually callable.

 For the same reason that the following doesn't work

 class A (object):

 def __init__(self):
 self.__call__ = A.hello

 def hello (self):
 print 'Hello, world!'

 a = A()
 a()

 Traceback (most recent call last):
   File D:\Python\modules\testclasscall.py, line 10, in ?
 a()
 TypeError: 'A' object is not callable

 The __call__ attribute must be defined on the class (or type) - not on
 the instance. A module is an instance of type 'module'.


A very easy example:

  class A:
 ... def __call__(self):
 ... print 'call'
 ...
  a = A()
  a()
 call

I'm not sure that module can also has __call__() method just like
class. I havn't seen the way before.

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module with __call__ defined is not callable?

2006-02-07 Thread limodou
On 2/8/06, adam johnson [EMAIL PROTECTED] wrote:
 Thanks for you answer.

 I was under the impression that you could tack methods onto an object at any
 time, your example almost works with old style classes and would with a
 function instead of a method.

  class A:
 ... def __init__(self):
 ... self.__call__ = A.hello
 ... def hello(self):
 ... print Hello, world!
 ...
  a = A()
  a()
 Traceback (most recent call last):
   File stdin, line 1, in ?
 TypeError: unbound method hello() must be called with A instance as first
 argument (got nothing instead)
  a(a)
 Hello, world!
 

 So now all I need to know is why now with new style classes the special
 functions need to be defined on the class instead of attached to the
 instance at any time.

don't need do like above!

  class A:
 ... def __init__(self):
 ... A.__call__ = A.hello
 ... def hello(self):
 ... print Hello, world!

  a = A()
  a()
 Hello, world!

You should review the bound method and unbound method.

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module with __call__ defined is not callable?

2006-02-07 Thread limodou
On 2/8/06, Delaney, Timothy (Tim) [EMAIL PROTECTED] wrote:
 limodou wrote:

  On 2/8/06, adam johnson [EMAIL PROTECTED] wrote:
  Thanks for you answer.
 
  I was under the impression that you could tack methods onto an
  object at any time, your example almost works with old style classes
  and would with a function instead of a method.

 In fact it will work if you change the A.hello to self.hello ...

 class A:

 def __init__(self):
 self.__call__ = self.hello

 def hello (self):
 print 'Hello, world!'

 a = A()
 a()

 Hello, world!

  So now all I need to know is why now with new style classes the
  special functions need to be defined on the class instead of
  attached to the instance at any time.

 http://users.rcn.com/python/download/Descriptor.htm

  don't need do like above!
 
class A:
   ... def __init__(self):
   ... A.__call__ = A.hello
   ... def hello(self):
   ... print Hello, world!
 
a = A()
a()
   Hello, world!
 
  You should review the bound method and unbound method.

 This has nothing to do with it - in the above example, you are setting
 the *class* attribute of a user-defined class (which allows setting
 additional attributes) - which therefore makes instances callable.

Of course I know that.

 Compare the equivalent for the current module:

 import sys

 def hello (self):
 print 'Hello, world!'

 m = sys.modules[__name__]
 mc = type(m)
 mc.__call__ = hello

 Traceback (most recent call last):
   File D:\Python\modules\testclasscall.py, line 7, in ?
 mc.__call__ = hello
 TypeError: can't set attributes of built-in/extension type 'module'

The exception is right, some special method cannot be replace for some
built-in type(new-style class). I just don't suggest adding __call__()
to a module, I don't know why does he need this. Because I think the
module normally works like a namespace.

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Size of list

2006-02-06 Thread limodou
6 Feb 2006 08:32:18 -0800, Ernesto [EMAIL PROTECTED]:
 for line in PM_File_Handle.readlines():
 PM_fields = line.split(';')

 # Is there a way to get the size of PM_Fields here ?
 # Something like

 size = PM_fields.size( )

 #  I could not find this attribute in the python docs.  Thanks

try:

size = len(PM_fields)

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN:NewEdit 3.2 Released

2006-01-17 Thread limodou
What's it?


It's an Editor based on wxPython. NewEdit uses Mixin and Plugin
technique as its architecture. Most of its classes can be extended via
mixin and plugin components, and finally become an integrity class at
creating the instance. So NewEdit is very dynamic. You can write the
new features in new files, and hardly need to modify the existing
code. And if you want to extend the existing classes, you could write
mixins and plugins, and this will be bound to the target class that I
call Slot Class. This technique will make the changes centralized
and easily managed.

What are its features?


   *  Cross platform
 o  based on wxPython, so it can run anywhere that wxPython
works, such as: Windows, Linux.
 o   Unicode support.
   *  Most features of wxStyledTextCtrl(Scintilla)
 o   Syntax highlighting, support Python, c/c++, html, plain
text, perl, ruby, css, javascript
 o   Folding
 o   Brace Matching
 o   ...
   *  Extended selection
 o   Extended word selection -- You can press
Ctrl+?MouseDoubleClick to select a word including '.'
 o   Matched selection -- Select text in quoted chars like:
(), [], {}, '', .
   *  Other editing extension
 o   Duplicating text -- Just like Vim Ctrl+V, Ctrl+P, and
more. You can duplicate above or below char, word, line
 o   Quoting text -- Add some quoted chars before and after
selected text, just as: , '', (), [], {}, and
 o   Text convertion and view -- python - html, reStructured
Text - html, textile - html, and you can output or view
 o   Utf-8 encoding auto detect
 o   Changing document encoding
 oAuto backup
 oLast session support -- It'll save all the filenames as
closed, and reopen the files as next started.
 oSmart judge the indent char -- It'll auto guess the
indent char, and sets it.
 oFinding in files
 oBookmark support
   *  Python support
 obuilt-in python interactive window based on ?PyShell,
support Unicode
 oAuto completion
 o   Function syntax calltips
 o   Run, run with argument, stop python source
 o   Auto change current path
 o   Python class browser
   *  Code snippets
 o  You can manage your code snippets with categories, and
each category can have many items. Every item will represent a code
snippet. You can insert an item just by double-clicking on it. It even
supports importing and exporting.
   *  Simple project support
 o  Can create a special file _project, so every file and
folder under the folder which has the _project can be considered as a
whole project.
   *  Extension mechanism
 o  Script -- You can write easy script to manipulate the all
resource of NewEdit, just like: text conversion, etc.
 o  Plugin -- Customized function. More complex but more
powerful. Can easily merge with NewEdit, and can be managed via menu.
 o  Shell command -- Add often used shell commands, and execute them.
   *  Ftp support
 o  You can edit remote files through ftp. You can add,
rename, delete, upload, download file/directory.
   *  Multilanguage support
 o  Currently supports two languages: English and Chinese,
which can be auto-detected.
   *  Shipped plugins(must be configed as used them before)
 o  Document links -- Python documentation and wxPython documentation.
 o  Many plugins can be found at NewEdit wiki page.
   *  Shipped scripts
 o  Many scripts can be found at NewEdit wiki page.
   *  Wizard (New)
 o You can make your own wizard template. The wizard can
input user data, combine with template, and output the result. And
wizard also support code framework created. This feature will help you
improving coding efficiency.
   *  Direcotry Browser(New)
 o   Browse multiple directories, and you can really add,
delete, rename directories and files. Double click will open the file
in Editor window.
   *  AutoComPlete(acp)(New)
 o   Suport user autocomplete file, it can help to input code
very helpful and functional. Just like EditPlus, but may be more
powerful.

Where to download it?


download lastest version 3.2:
http://wiki.woodpecker.org.cn/moin/NewEdit?action=AttachFiledo=gettarget=newedit_3.2.zip
also have windows installer:
http://wiki.woodpecker.org.cn/moin/NewEdit?action=AttachFiledo=gettarget=NewEdit3.2.exe
wiki: http://wiki.woodpecker.org.cn/moin/NewEdit
svn: http://cvs.woodpecker.org.cn/svn/woodpecker/newedit
maillist: http://groups.google.com/group/NewEdit

If you have any problem as using NewEdit, welcome to join the NewEdit
maillist to discuss.

Hope fun!

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation

ANN:NewEdit 3.2 Released

2006-01-17 Thread limodou
What's it?


It's an Editor based on wxPython. NewEdit uses Mixin and Plugin
technique as its architecture. Most of its classes can be extended via
mixin and plugin components, and finally become an integrity class at
creating the instance. So NewEdit is very dynamic. You can write the
new features in new files, and hardly need to modify the existing
code. And if you want to extend the existing classes, you could write
mixins and plugins, and this will be bound to the target class that I
call Slot Class. This technique will make the changes centralized
and easily managed.

What are its features?


   *  Cross platform
 o  based on wxPython, so it can run anywhere that wxPython
works, such as: Windows, Linux.
 o   Unicode support.
   *  Most features of wxStyledTextCtrl(Scintilla)
 o   Syntax highlighting, support Python, c/c++, html, plain
text, perl, ruby, css, javascript
 o   Folding
 o   Brace Matching
 o   ...
   *  Extended selection
 o   Extended word selection -- You can press
Ctrl+?MouseDoubleClick to select a word including '.'
 o   Matched selection -- Select text in quoted chars like:
(), [], {}, '', .
   *  Other editing extension
 o   Duplicating text -- Just like Vim Ctrl+V, Ctrl+P, and
more. You can duplicate above or below char, word, line
 o   Quoting text -- Add some quoted chars before and after
selected text, just as: , '', (), [], {}, and
 o   Text convertion and view -- python - html, reStructured
Text - html, textile - html, and you can output or view
 o   Utf-8 encoding auto detect
 o   Changing document encoding
 oAuto backup
 oLast session support -- It'll save all the filenames as
closed, and reopen the files as next started.
 oSmart judge the indent char -- It'll auto guess the
indent char, and sets it.
 oFinding in files
 oBookmark support
   *  Python support
 obuilt-in python interactive window based on ?PyShell,
support Unicode
 oAuto completion
 o   Function syntax calltips
 o   Run, run with argument, stop python source
 o   Auto change current path
 o   Python class browser
   *  Code snippets
 o  You can manage your code snippets with categories, and
each category can have many items. Every item will represent a code
snippet. You can insert an item just by double-clicking on it. It even
supports importing and exporting.
   *  Simple project support
 o  Can create a special file _project, so every file and
folder under the folder which has the _project can be considered as a
whole project.
   *  Extension mechanism
 o  Script -- You can write easy script to manipulate the all
resource of NewEdit, just like: text conversion, etc.
 o  Plugin -- Customized function. More complex but more
powerful. Can easily merge with NewEdit, and can be managed via menu.
 o  Shell command -- Add often used shell commands, and execute them.
   *  Ftp support
 o  You can edit remote files through ftp. You can add,
rename, delete, upload, download file/directory.
   *  Multilanguage support
 o  Currently supports two languages: English and Chinese,
which can be auto-detected.
   *  Shipped plugins(must be configed as used them before)
 o  Document links -- Python documentation and wxPython documentation.
 o  Many plugins can be found at NewEdit wiki page.
   *  Shipped scripts
 o  Many scripts can be found at NewEdit wiki page.
   *  Wizard (New)
 o You can make your own wizard template. The wizard can
input user data, combine with template, and output the result. And
wizard also support code framework created. This feature will help you
improving coding efficiency.
   *  Direcotry Browser(New)
 o   Browse multiple directories, and you can really add,
delete, rename directories and files. Double click will open the file
in Editor window.
   *  AutoComPlete(acp)(New)
 o   Suport user autocomplete file, it can help to input code
very helpful and functional. Just like EditPlus, but may be more
powerful.

Where to download it?


download lastest version 3.2:
http://wiki.woodpecker.org.cn/moin/NewEdit?action=AttachFiledo=gettarget=newedit_3.2.zip
also have windows installer:
http://wiki.woodpecker.org.cn/moin/NewEdit?action=AttachFiledo=gettarget=NewEdit3.2.exe
wiki: http://wiki.woodpecker.org.cn/moin/NewEdit
svn: http://cvs.woodpecker.org.cn/svn/woodpecker/newedit
maillist: http://groups.google.com/group/NewEdit

If you have any problem as using NewEdit, welcome to join the NewEdit
maillist to discuss.

Hope fun!

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting module location

2006-01-04 Thread limodou
2006/1/5, Thomas Dybdahl Ahle [EMAIL PROTECTED]:
 Is it possible for an imported module to find its own location?

you can access __file__(missing for built-in modules) or __path__(used
for a package) attribute to find a module's location.

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: why writing list to file puts each item from list on seperate line?

2005-12-30 Thread limodou
30 Dec 2005 20:22:52 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED]:
 if i use the code below to write a list to a file

 list = (food, price, store)
 data.append(list)
 f = open(rtest.txt, 'a')
 f.write ( os.linesep.join( list ) )


 it outputs to a file like this

 apple
 .49
 star market

 and i want it to do

 apple, .49. star market

 any ideas


my box is windows xp, so :

  print repr(os.linesep)
 '\r\n'

 If you want to seperate them with space, you should:

f.write ( ''.join( list ) )

 and list = (food, price, store)
 the list is not called list, but tuple, a real list should be

aList = [food, price, store]
--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: why writing list to file puts each item from list on seperate line?

2005-12-30 Thread limodou
30 Dec 2005 20:44:29 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED]:
 i want them to be on the same line when they are written to the file.
 right now they are written like this:

 food
 price
 store

 i want them to be written like this

 food price store

 how do i do that?


  print ' '.join(['food', 'price', 'store'])

os.linesep represents newline.


--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: reading files into dicts

2005-12-29 Thread limodou
2005/12/30, rbt [EMAIL PROTECTED]:
 What's a good way to write a dictionary out to a file so that it can be
 easily read back into a dict later? I've used realines() to read text
 files into lists... how can I do the same thing with dicts? Here's some
 sample output that I'd like to write to file and then read back into a dict:

 {'.\\sync_pics.py': 1135900993, '.\\file_history.txt': 1135900994,
 '.\\New Text Document.txt': 1135900552}
 --
 http://mail.python.org/mailman/listinfo/python-list


You can try the dict4ini module written by me.

http://wiki.woodpecker.org.cn/moin/Dict4Ini

The dict can be saved as an Ini file, and can be read back from the
Ini file.Just like:

  import dict4ini
  x = {'.\\sync_pics.py': 1135900993, '.\\file_history.txt':
1135900994, '.\\New Text Document.txt': 1135900552}
  d = dict4ini.DictIni(values=x)
  d['.\sync_pics.py']
 1135900993

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Fwd: oddness question for threading in pyw

2005-12-26 Thread limodou
I forward this letter from wxPython maillist, because it seems that no
one answers my question, so I want to ask somebody for help in here.
Thanks.

-- Forwarded message --
From: limodou [EMAIL PROTECTED]
Date: 2005-12-26 下午3:06
Subject: oddness question for threading in pyw
To: [EMAIL PROTECTED]


When I'm dealing theading program in wxPython, I find an oddness
question. If the python filename is '.pyw' suffixed, and the thread is
set as daemon, when I double clicked it to run, the thread object
seems be blocked till I exit the program. But if the thread is not set
as daemon, every thing is ok. But if the python filename is not '.pyw'
suffixed, but '.py', the question is disappeared. Can anybody explain
it for me, and how to resolved it? Need I change the deamon to false?

There is a testing program, which I modified from the wxPython Threading Demo.

import  random
import  time
import  thread
import threading

import  wx
import  wx.lib.newevent

#--

# This creates a new Event class and a EVT binder function
(UpdateBarEvent, EVT_UPDATE_BARGRAPH) = wx.lib.newevent.NewEvent()


#--

class CalcBarThread(threading.Thread):
def __init__(self, win, barNum, val):
threading.Thread.__init__(self, name=CalcBarThread)
self.win = win
self.barNum = barNum
self.val = val
self.keepGoing = self.running = True

def Start(self):
self.keepGoing = self.running = True
thread.start_new_thread(self.Run, ())

def Stop(self):
self.keepGoing = False

def IsRunning(self):
return self.running

def run(self):
while self.keepGoing:
evt = UpdateBarEvent(barNum = self.barNum, value = int(self.val))
wx.PostEvent(self.win, evt)

sleeptime = (random.random() * 2) + 0.5
time.sleep(sleeptime/4)

sleeptime = sleeptime * 5
if int(random.random() * 2):
self.val = self.val + sleeptime
else:
self.val = self.val - sleeptime

if self.val  0: self.val = 0
if self.val  300: self.val = 300

self.running = False

#--


class GraphWindow(wx.Window):
def __init__(self, parent, labels):
wx.Window.__init__(self, parent, -1)

self.values = []
for label in labels:
self.values.append((label, 0))

font = wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)
self.SetFont(font)

self.colors = [ wx.RED, wx.GREEN, wx.BLUE, wx.CYAN,
Yellow, Navy ]

self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
self.Bind(wx.EVT_PAINT, self.OnPaint)


def SetValue(self, index, value):
assert index  len(self.values)
cur = self.values[index]
self.values[index:index+1] = [(cur[0], value)]


def SetFont(self, font):
wx.Window.SetFont(self, font)
wmax = hmax = 0
for label, val in self.values:
w,h = self.GetTextExtent(label)
if w  wmax: wmax = w
if h  hmax: hmax = h
self.linePos = wmax + 10
self.barHeight = hmax


def GetBestHeight(self):
return 2 * (self.barHeight + 1) * len(self.values)


def Draw(self, dc, size):
dc.SetFont(self.GetFont())
dc.SetTextForeground(wx.BLUE)
dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
dc.Clear()
dc.SetPen(wx.Pen(wx.BLACK, 3, wx.SOLID))
dc.DrawLine(self.linePos, 0, self.linePos, size.height-10)

bh = ypos = self.barHeight
for x in range(len(self.values)):
label, val = self.values[x]
dc.DrawText(label, 5, ypos)

if val:
color = self.colors[ x % len(self.colors) ]
dc.SetPen(wx.Pen(color))
dc.SetBrush(wx.Brush(color))
dc.DrawRectangle(self.linePos+3, ypos, val, bh)

ypos = ypos + 2*bh
if ypos  size[1]-10:
break


def OnPaint(self, evt):
width, height = size =self.GetSize()
bmp = wx.EmptyBitmap(width, height)

dc = wx.MemoryDC()
dc.SelectObject(bmp)


self.Draw(dc, size)

wdc = wx.PaintDC(self)
wdc.BeginDrawing()
wdc.Blit(0,0, size[0], size[1], dc, 0,0)
wdc.EndDrawing()

dc.SelectObject(wx.NullBitmap)


def OnEraseBackground(self, evt):
pass




#--

class TestFrame(wx.Frame):
def __init__(self, parent, log):
wx.Frame.__init__(self, parent, -1, Thread Test, size=(450,300))
self.log = log

#self.CenterOnParent()

panel = wx.Panel(self, -1)
panel.SetFont(wx.Font(10

Re: __slots__ and copy again: why does it work?

2005-12-26 Thread limodou
26 Dec 2005 20:33:35 -0800, fortepianissimo [EMAIL PROTECTED]:
 Mystery solved - when there's only one slot I should've used __slots__
 = ('i', ). Duh!

 So in short, __slots__ and copy.copy() work fine in Python 2.4.2.

Hard works, but very useful :)


--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE (was: PythonWin troubleshooting)

2005-12-15 Thread limodou
15 Dec 2005 18:03:27 -0800, Martin Miller [EMAIL PROTECTED]:
 You might want to also to consider the Komodo IDE from ActiveState (the
 same company that produces ActivePython and hosts the ASPN Cookbook).
 This isn't an endorsement -- I have no experience with it --  but its
 feature set looks good  [see http://activestate.com/Products/Komodo].

 If someone with actual experience using Komodo with Python is
 listening, I'd be very interested in hearing what you think of it or
 other alternatives (I plan on taking a look at PyScripter and any
 others I hear about).


Try NewEdit for a test.

http://wiki.woodpecker.org.cn/moin/NewEdit

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


ReSend: ANN: EasyGuider 0.1 Released!

2005-12-14 Thread limodou
I'm sorry for resend the letter again. Because the whole project is
rename to a new name.

= What's it =

It's a GUI toolkit based on wxPython. So if you want to use it you
need to install wxPython on your box. The main idea of it is Data
Driven. Because I found many times, what I want just a GUI interface
to gain some data from the user, and I don't care about the beauty of
the interface. And if I have time, I can promote the GUI interface
later. In the earlier of the project, what I want just is quicker and
quicker. And I also realized that, the GUI interface is easy to
change, but the data is not the same. So I want to made a GUI toolkit
to implement that: a GUI auto creating toolkit based on data driven.
That is why the EasyGuider be found.

There is lack of documents, but I'll do my best to do that.

So according the idea, the main work you need to do is design the data
model, and other things is left for EasyGuider. But the data model I
designed is very simple, just a tuple list, so you can very easily to
write the model.

= What's the status of the project =

It's still on developing. And main document is written in Chinese, I'm
sorry for that. But if you have any question, you can send me email
directly, I'll very glad to discuss with you.

= Where to download =

You can download it at here
http://wiki.woodpecker.org.cn/moin/EasyGuider/?action=AttachFiledo=gettarget=EasyGuider-0.1.tar.gz

maillist: http://groups.google.com/group/EasyGuider
wiki: http://wiki.woodpecker.org.cn/moin/EasyGuider
--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN:Dict4Ini 0.3 released!

2005-12-10 Thread limodou
This module is used to process ini format configuration file. It acts
just like a dict, but you can also access it's sections and options
with attribute syntax, just like x.test.

== What's it features ==

 * as simple as others
 * you can access options according to dict syntax, just like
x['name']['o'] = 1, x['name'].keys(), x['name'].values(), etc.
 * you also can access options according to attr syntax, just like
x.name.o = 1, x.name.keys(), x.name.values(), etc. So the name must be
Identifier or single word.
 * you can save comments in it(but this feature is not tested so much)
 * support multi level section, subsection name will just like: [firsub/secsub]
 * can save config items order
 * support multi data types: string, unicode, int, float, list/tuple,
dict, etc, you can save them to or regain them from config file
 * can convert to dict '''new'''
 * It's a little module, just for my mind, so if you like, you could
try it, but if you don't like, just skip it, that's ok

== Where can I download it? ==

 * Visit the http://wiki.woodpecker.org.cn/moin/Dict4Ini site
 * Download it from here attachment:dict4ini.py

== What's new? ==
 * 2005/12/09 Version 0.3
  * Adding dict() method, then you can change the DictIni object to
dict type, so you can really use it as a dict alternative

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


Re: Newbie wxPython ListCtrl Question

2005-11-16 Thread limodou
2005/11/17, Todd7 [EMAIL PROTECTED]:
 I am new to python and to wxWindows.  I have tried searching google,
 reading the documentation and trying to figure out some of the examples,
 but I am stumped as to how to get information out of a listctrl at a
 certain row and column.  I tried to write a simple example to learn to
 work with the listctrl as follows:

I'v made some helper function as that:

def getRowText(self, index, col):
if index = 0:
return self.list_ctrl_1.GetItem(index, col).GetText()
else:
return ''

def getSelRowText(self, col):
return self.getRowText(self.getSelection(), col)

def getSelection(self):
return self.list_ctrl_1.GetNextItem(-1, wx.LIST_NEXT_ALL,
wx.LIST_STATE_SELECTED)

You can just use self.getSelRowText(1) to gain the second column text
of selection row.
--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I create a dir using Python.

2005-11-08 Thread limodou
8 Nov 2005 23:00:09 -0800, sumi [EMAIL PROTECTED]:
 How do i create a dir using python.


import os
os.mkdir(path)

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help with unicode and sqlobject/pysqlite2

2005-09-28 Thread limodou
28 Sep 2005 00:25:31 -0700, qvx [EMAIL PROTECTED]:
 I really can't seem to make sqlobject/pysqlite2 save my local Easter
 European characters.

 I am a Windows-1250 user and I have sys.setdefaultencoding('dbcs') in
 my sitecustomize.

 How can I save data like šdccž?
 This is equivalent to '\x9a\xf0\xe8\xe6\x9e'

 I'm using the latest version of sqlobject from SVN.

 qvx


I don't know about Easter European characters, but I think you should
convert your characters into unicode first.

--
I like python!
My Donews Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: stdin - stdout

2005-08-19 Thread limodou
2005/8/19, max(01)* [EMAIL PROTECTED]:
 hi.
 
 i was wondering, what's the simplest way to echo the standard input to
 the standard output, with no modification.
 
 i came up with:
 
 ...
 while True:
try:
  raw_input()
except EOFError:
  break
 ...
 
 but i guess there must be a simpler way.
 
 using bash i simply do 'cat', *sigh*!
 
 bye
 
 max
 
 ps: in perl you ca do this:
 
 ...
 while ($line = STDIN)
{
  print STDOUT ($line);
}
 ...

Try this.

import sys

line = sys.stdin.readline()
while line:
sys.stdout.write(line)
line = sys.stdin.readline()

-- 
I like python! 
My Donews Blog: http://www.donews.net/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Some question about setuptools module

2005-08-05 Thread limodou
I'm new to setuptools. 

One question is:

Recently I want to use setuptools for a project. My command line is just like :

python setup.py sdist --formats=gztar

But I found some deleted files also included in the package. These
files are .pyc suffixed. I use subversion. I checked the setuptools'
code, and found that setuptools indeed follows the .svn/entries file,
but it only retrieves files, and check if the file is exist. But in my
entries file, just like:

entry
   name=EasyElements.pyc
   kind=file
   deleted=true
   revision=33/

You can see the deleted field is true, so the file should not be
included in the package, even through the file is exist. So I think
maybe the .pyc, .pyo file should be omited.

The another question is:

I have below directory structure:

A/
 setup.py
 B/
  __init__.py
  b.py
  t.txt
  .svn/
entries

So B is a package dir. But as I run setup.py, the t.txt is not include
in the package. I followed the source code and found it was because
that dir A hasn't in version control, i.e. there is not .svn directory
in dir A, so the setuptools could not traversal the subdirectory. I
don't know how to write my setup.py script.

I'm sorry may be this letter is not suit for this maillist.


-- 
I like python! 
My Donews Blog: http://www.donews.net/limodou
New Google Maillist: http://groups-beta.google.com/group/python-cn
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some question about setuptools module

2005-08-05 Thread limodou
2005/8/5, Robert Kern [EMAIL PROTECTED]:
 limodou wrote:
 
  I'm sorry may be this letter is not suit for this maillist.
 
 You'll get better help on the Distutils-SIG list.
 
 http://mail.python.org/mailman/listinfo/distutils-sig/
 
 Phillip Eby hangs out there for the care and feeding of setuptools adopters.
 

Thanks I'll try there.

-- 
I like python! 
My Donews Blog: http://www.donews.net/limodou
New Google Maillist: http://groups-beta.google.com/group/python-cn
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 问个关于emule的问题

2005-06-25 Thread limodou
This is a Englist maillist, you should better use English. And your
question is not about Python, you should ask it in emule maillist.

在 05-6-25,Denton[EMAIL PROTECTED] 写道:
 近日找个东西,最后在emule上找到了,还只有一个源
 
 排队等了半天也没轮到.,最后找了个坛子去求档了
 
 平日很少用emule  想问问emule排队和积分的关系
 
 是不是积分是一对一的,并不是按自己总的上传下载量来计算的?
 
 如果对方不从我这里下载东西,我只能通过排队时间来提高自己的积分?
 
 我给其他人的上传量无法改变我在对方的积分�
 
 
 --
 http://mail.python.org/mailman/listinfo/python-list
 
 


-- 
I like python! 
My Donews Blog: http://www.donews.net/limodou
New Google Maillist: http://groups-beta.google.com/group/python-cn
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Frog 1.4 (web log aka blogging server)

2005-04-23 Thread limodou
great!

How about change the bbcode like editor to FCKeditor? I think
FCKeditor is much better, or make it as an optional editor which the
user could select it himself.

2005/4/23, Irmen de Jong [EMAIL PROTECTED]:
 I've released a new version of Frog, a web log
 aka blogging server written in 100% python.
 
 Get version 1.4 from http://snakelets.sourceforge.net/frog/index.html
 
 (note: storage file format has been changed since v1.3)
 
 Some of the more interesting features are:
 
 - multi user
 - no database needed (uses files for storage)
 - no web server needed (it runs in Snakelets,
 which has its own web server)
 - splitted articles (read more...)
 - email notification when comment is added
 - formatting similar to 'bbcode', supports images and other files
 - anti-spam measures: puzzles, auto-updating link blacklist,
anti-indexing hyperlinks in comments (rel=nofollow)
 - outputs lean xhtml+css pages
 - fully unicode compatible
 - web-based file manager, available as separate module
 
 Have fun :)
 
 --Irmen
 
 PS You can see Frog in action here:
  http://www.razorvine.net/snake/frog/user/irmen/
 --
 http://mail.python.org/mailman/listinfo/python-announce-list
 
 Support the Python Software Foundation:
 http://www.python.org/psf/donations.html
 


-- 
I like python! 
My Donews Blog: http://www.donews.net/limodou
New Google Maillist: http://groups-beta.google.com/group/python-cn
--
http://mail.python.org/mailman/listinfo/python-list


Re: Source Encoding GBK/GB2312

2005-02-23 Thread limodou
2.4 support gb2312, gbk, gb18030 and cjk codec.
you can also move these things to 2.3.


On Wed, 23 Feb 2005 22:34:02 -0600, Steve Holden [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
 
  When I specify an source encoding such as:
 
  # -*- coding: GBK -*-
  or
  # -*- coding: GB2312 -*-
 
  as the first line of source, I got the following error:
 
  SyntaxError: 'unknown encoding: GBK'
 
 
  Does this mean Python does not support GBK/GB2312?  What do I do?
 
 
 Well, *your* Python might not support GTK:
 
 [EMAIL PROTECTED] ~
 $ cat test90.py
 # -*- coding: GBK -*-
 
 print Hello!
 
 [EMAIL PROTECTED] ~
 $ python test90.py
 Hello!
 
 but Python generally appears to. Do you have encodings/gbk.py in your
 library?
 
 regards
   Steve
 
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
I like python! 
My Blog: http://www.donews.net/limodou
New Maillist: http://groups-beta.google.com/group/python-cn
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: safest way to kill a thread

2005-01-18 Thread limodou
Using Thread's method setDaemon() before you call the start() method. 
Just like :

t.setDaemon(True)
t.start()
[EMAIL PROTECTED] wrote:
Dear all,
in python, a thread can be created by t = threading.Thread. But i
found that when the main (and the thread) program is running and user
use Crtl+C/Crtl+Z to break the program abnormally, the thread is still
running and needed to kill manually (by the pid). Is there had any
safest way to kill/exit the thread program under python (when the
thread program part is a forever loop)?
Thank a lot
--
I love python!
My Blog: http://www.donews.net/limodou
--
http://mail.python.org/mailman/listinfo/python-list


Re: safest way to kill a thread

2005-01-18 Thread limodou
I think only those threads which invoked with setDaemon() method will 
exit, and others will not,  as the main program exit.

[EMAIL PROTECTED] wrote:
limodou wrote:
Using Thread's method setDaemon() before you call the start() method.
Just like :
t.setDaemon(True)
t.start()
thank for fast reply.
from python.org doc, said that setDaemon() function as
The entire Python program exits when no active non-daemon threads
are left.
is it mean that when the main program exit (normally/abnormally), all
threads created will also exit?
  Thank again.
--
I love python!
My Blog: http://www.donews.net/limodou
--
http://mail.python.org/mailman/listinfo/python-list