ANN: Dejavu 1.5.0RC1

2007-01-24 Thread Robert Brewer
ttp://projects.amor.org/dejavu/wiki/UpgradeTo1.5 Documentation for 1.5: http://projects.amor.org/docs/dejavu/1.5.0RC1/ Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Talks at PyCon that Teach How to Be Better Programmers

2006-10-24 Thread Robert Brewer
st reduce [len(dir(obj)) for obj in all_obj]. 2. Dynamic languages naturally more lang-maven oriented? See http://osteele.com/archives/2004/11/ides III. Programmable = 1. Config and other "declarative" modes: No "XML sit-ups" IV. Readable = Simple ===

Iterators everywhere in Python 3000 (was: Why is dictionary.keys() a list and not a set?)

2005-11-24 Thread Robert Brewer
affected, with no interface layer in-between to call list() for you. [I wonder how the PyPy folks feel about "iterators everywhere"...?] Given my experience with Dejavu, I'd rather not see Python 3000 move to using iterators with abandon. IMO, it fixes a poor interface (iter) for 5%

RE: Reinvent no more forever

2005-11-16 Thread Robert Brewer
pendency tools" are distressingly common, and cost more than reinvention? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Framework that works with IIS/SQL Server?

2005-11-03 Thread Robert Brewer
SQL Server in SQLObject, which both frameworks also use: http://sqlobject.org/SQLObject.html#ms-sql-server I use bare CherryPy with my own ORM, which handles SQL Server quite well: http://projects.amor.org/dejavu Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail

RE: How to add one month to datetime?

2005-10-21 Thread Robert Brewer
h + 1, olddate.day) will roll over any values which are out-of-bounds for their container. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: sqlstring -- a library to build a SELECT statement

2005-10-20 Thread Robert Brewer
gt;>> print model.person > >SELECT > >person.* > >FROM > >[person] person > > The [bracket] syntax is unique to Microsoft. > Everyone else, including Microsoft SQL Server, > uses "double quotes" to protect special characters > in identifiers. E

RE: How to get listed on planet.python.org

2005-10-18 Thread Robert Brewer
t=Python I'm pretty sure you should just email [EMAIL PROTECTED] with your request. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Will python never intend to support private, protected and public?

2005-10-08 Thread Robert Brewer
s on topics which I would not otherwise have read. ;) Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: distutils and decorators

2005-09-23 Thread Robert Brewer
Benji York wrote: > Robert Brewer wrote: > > Actually, in this case we most definitely want to test > > 2.4's "@" syntax. The decorator in question is an aliaser, > > and therefore is one of the few > > decorators which must be implemented differently

RE: distutils and decorators

2005-09-21 Thread Robert Brewer
See the "expose" function at: http://www.cherrypy.org/file/trunk/cherrypy/__init__.py?rev=654 Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

distutils and decorators

2005-09-21 Thread Robert Brewer
2.4, or 3. Is there some better way to optionally test decorators, like using eval, or 4. other...? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: CGI File Uploads and Progress Bars

2005-09-08 Thread Robert Brewer
cgi.FieldStorage, and override make_file to provide your own file-like object that you can monitor as its "write" method is called (see read_binary for the actual upload r/w code). The existing FieldStorage class places the file size (gleaned from the Content-Length request header) into sel

RE: Multiple (threaded?) connections to BaseHTTPServer

2005-08-23 Thread Robert Brewer
tly hoping for was that you'd read up on CherryPy and discover it already does what you want. ;) Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Multiple (threaded?) connections to BaseHTTPServer

2005-08-23 Thread Robert Brewer
P code)? Do you *really* want to reinvent that wheel? ;) I'd suggest you start with a threaded HTTP server from one of Python's many web frameworks. Since I hack on CherryPy, I'll link you to its liberally-licensed PooledThreadServer: http://www.cherrypy.org/file/trunk/cherrypy/_cpht

RE: WSGI-server in the standard distro?

2005-08-07 Thread Robert Brewer
the reference server that comes with wsgiref (which is what they based their WSGI server on). If there are any licensing or other issues keeping django from using the CherryPy WSGI server, swing by irc://irc.oftc.net/cherrypy and we'll get them worked out in a hurry. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: ANN: CherryPy-2.1.0-beta released

2005-07-15 Thread Robert Brewer
nfiguration entries are specifiable per-path, so different portions of your site can use different encoding schemes. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Yet Another Python Web Programming Question

2005-07-10 Thread Robert Brewer
Paul Boddie wrote: > "Robert Brewer" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > > Daniel Bickett wrote: > > > I neglected to mention an important fact, and that is the > > > fact that I am limited to Apache,

RE: Yet Another Python Web Programming Question

2005-07-09 Thread Robert Brewer
l a great option for you with Apache: http://www.cherrypy.org/wiki/WSGIServers http://www.cherrypy.org/wiki/BehindApache Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Debugger Confusion

2005-06-28 Thread Robert Brewer
ve, so you can inspect program variables as you like. Start with that, and come back if you have any more questions. :) Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: unittest: collecting tests from many modules?

2005-06-26 Thread Robert Brewer
I overrode loadTestsFromName in a subclass, in order to be less verbose in exactly the way I wanted, but the default works just as well). Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: processing a Very Large file

2005-05-17 Thread Robert Brewer
,0k free, > 27416k cached > > At this point, my computer becomes unusable. > > I'd like to know if I should buy some more memory (a few GB?) > or if it is > possible to make my code more memory efficient. The first question I would ask is: what are you doing with "result", and can the consumption of "result" be done iteratively? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Is isinstance always "considered harmful"?

2005-05-15 Thread Robert Brewer
is.cx/publish/programming/charming_python_b12.html) and generic functions (cf http://dirtsimple.org/2004/11/generic-functions-have-landed.html). Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] > To me, > instanceof seems like the infimum of all possible evils in this case. >

RE: how to calc the difference between two datetimes?

2005-05-08 Thread Robert Brewer
n should I use? Use datetime.datetime objects and subtract one from the other: http://docs.python.org/lib/datetime-datetime.html import datetime time0 = datetime.datetime(2005, 5, 6, 23, 3, 44) time1 = datetime.datetime(2005, 5, 7, 3, 3, 44) td = time1 - time0 print 'time difference is %s seco

RE: Quick and dirty dialogs?

2005-05-02 Thread Robert Brewer
rking > well enough to find it. If by "didn't need TK" you mean "I don't want to have to learn Tk", try Steve Ferg's EasyGUI: http://www.ferg.org/easygui/ Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: pre-PEP: Suite-Based Keywords

2005-04-18 Thread Robert Brewer
'y for g', > foo=lambda: return 'foo for g' ) Which are both prettier, until you actually try to use them: >>> g( *args_from_somewhere, x='x for g', y='y for g', foo=lambda: return 'foo for g' ) Traceback ( File

RE: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-16 Thread Robert Brewer
Bengt Richter wrote: > The '::' unary suite operator should return an ordered dict > subtype representing the bindings Why ordered? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: [perl-python] Python documentation moronicities (continued)

2005-04-12 Thread Robert Brewer
His vitriol should at least warrant a temporary ban. No money need change hands. Top-posting-because-it-wasn't-worth-quoting, Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf

RE: Web application toolkit recommendation?

2005-04-04 Thread Robert Brewer
called Dejavu (http://www.aminus.org/rbre/python/) which needs more use cases ;) Or is there something special about webapps which you feel requires a database module to be integrated with the app framework? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: How to create datetime object from DbiDate (win32.odbc)?

2005-03-17 Thread Robert Brewer
st prize would be to have a datetime constructor that takes a > DbiDate object as input, in the same way that mx does, but this does > not seem to exist. Try: datetime.datetime.utcfromtimestamp(int(value)) I gave up on dbiDates completely, however, (since their range is so limited) and use

RE: Itertools wishlists

2005-03-14 Thread Robert Brewer
se ;): def is_string(item): return isinstance(item, basestring) def flatten(seq, atomic_test = is_string): ... Perhaps atomic_test could allow a tuple or list of tests and combine them...? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: hotshot ??

2005-03-11 Thread Robert Brewer
under OS > 10.3.8, if any > of that makes a difference. Nothing there prevents hotshot > from loading > a file that's been made without the lineevents=1 argument.) Sounds like you're hitting a known bug: http://sourceforge.net/tracker/index.php?func=detail&aid=900092&group_id =5470&atid=105470 Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Problematic behavior of the import statement when several modulefiles have the same name.

2005-03-09 Thread Robert Brewer
module > (database.py > file) in any PYTHONPATH directory. > > Are my observations correct? Is there something I ignored? Should > this be posted somewhere else? Short answer: don't use relative imports: from some_package import database http://docs.python.org/ref/import.html Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: recommended way of generating HTML from Python

2005-02-21 Thread Robert Brewer
cess logic. Now, getting into usability concerns (that framework and library authors tend to obsess over ;) may be too advanced for your class at the moment. But that's why recipes are recipes, not standard library modules: they're often biased toward quick and dirty scripting, not usable, maintainable edifices. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: "Best" way to SIGHUP spamd from web page?

2005-02-18 Thread Robert Brewer
int-checking, which isn't available in Python. I ended up writing a daemon (running as root) which simply listens on a local socket; when it receives any message, it HUPs spamd. Ugly but effective. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Calling a function from module question.

2005-02-17 Thread Robert Brewer
JRCondon wrote: > Sean, if you are asking what I think you are asking (I don't > think name hiding is the issue), you can use > > from module_name import * Sshh! We're obviously going to great lengths to not tell him about *. ;) Robert Brewer MIS Amor Ministries [EM

"Best" way to SIGHUP spamd from web page?

2005-02-17 Thread Robert Brewer
if anyone has recommendations for whose advice to ignore first. ;) Detailed explanations of your choice would be much appreciated, of course. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: replacing ASP/VBScript with Python

2005-02-15 Thread Robert Brewer
Peter Maas wrote: > Robert Brewer schrieb: > >>I'm now confident that it is doable and keen on finding > out. The usual > >>question: what is the one and best way to do it? ;) > > > > > > Python ASP (pywin32), but put as little code as possible in

RE: replacing ASP/VBScript with Python

2005-02-15 Thread Robert Brewer
Response) %> The only downside is that ASP expects a physical file for every URL, so you'll either have lots of dumb copies of the stub, or a single dispatcher (and the ugly URL's you wanted to avoid). With a little planning, you can have the stubs auto-generated. Database side: try them all and see which is best with your dataset. ;) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: customizing metaclass constructed classes

2005-02-15 Thread Robert Brewer
] base.create_special_property(C, DateColumn('start_date')) Slightly off-topic: if you really want to make it pretty, add a custom descriptor so you can write: class C(A): id = IntColumn(primaryKey=1,allowNull=0) name = TextColumn(allowNull=0,size=50) description = TextCo

RE: Help with embedding fully qualified script name

2005-02-14 Thread Robert Brewer
e = os.path.normpath(os.path.dirname(sys.argv[0])) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Python and version control

2005-02-09 Thread Robert Brewer
Peter Hansen wrote: > Carl wrote: > > What is the ultimate version control tool for Python if you > > are working in a Windows environment? > > I never liked coupling the two together like that. Instead > I use tools like TortoiseCVS or (now) TortoiseSVN with a > Subversion repository. These t

RE: Making dynamic data available via ODBC with Python

2005-02-07 Thread Robert Brewer
excel" and no frills; both IE and Firefox will use Excel to open it. Works wonderfully. Let me know if you need more details. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: bad generator performance

2005-02-05 Thread Robert Brewer
ruly non-recursive implementation would probably exist outside of whatever class you've got this method in, and would keep its own pointer to the current node as it traversed the tree. Hope that helps, Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Processes for Win32

2005-02-05 Thread Robert Brewer
hip.python.net/crew/theller/py2exe/). Then use: net start daemonsvc net stop daemonsvc Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Persistence design [was: RE: OT: why are LAMP sites slow?]

2005-02-04 Thread Robert Brewer
*my* projects. ;) One of my goals for Dejavu* (my ORM) is to abstract persistence to the point that you can easily test your actual, live dataset against many potential storage mechanisms (i.e. multiple DB's, but also shelve, etc.). I need to finish the migration tools, but it's well

RE: Converting a string to a function pointer

2005-02-04 Thread Robert Brewer
t any function in any module. The curse is that you can then import any function in any module. ;) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Python AST Sprint

2005-02-02 Thread Robert Brewer
ph/thread/20050104.014254.b2978a88.en.html#20050104 .014254.b2978a88 That should hold you until the sprint ;) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: variable declaration

2005-01-31 Thread Robert Brewer
Alex Martelli wrote: > > Robert Brewer <[EMAIL PROTECTED]> wrote: > > > Bah. Nothing teaches you a new language like having your > job depend upon > > it. People who study languages merely for "personal growth" > learn 50% of > > the syn

RE: variable declaration

2005-01-31 Thread Robert Brewer
ur job depend upon it. People who study languages merely for "personal growth" learn 50% of the syntax and 1% of the concepts, and then fritter that learning away on inconsequential newsgroups the world over. Alex Z, keep using and learning Python. Let it change your brain. Robert

RE: variable declaration

2005-01-30 Thread Robert Brewer
h > a feature, I just don't know about it? The feature is called "pychecker", and, although it isn't included in the standard distribution, it's readily available: http://pychecker.sourceforge.net/ Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Best python postgres module?

2005-01-28 Thread Robert Brewer
ltiple connections i have no real > testing environment, so any advice which one to use for different > usecases would be nice. If your "use cases" involve cross-platform development (i.e. Linux and Windows), pypgsql seems to fit the bill nicely. Robert Brewer MIS Amor Mi

RE: I want update one record using ADO,but I can't ,why?

2005-01-25 Thread Robert Brewer
lename with the schema, something like: "select * from %s.%s;" % (schema, tblName) It's possible the trailing semicolon is important to close the statement. The next thing to check would be permissions. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: I want update one record using ADO,but I can't ,why?

2005-01-25 Thread Robert Brewer
output? Error message? Does your update affect the membership of the record in the keyset? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/ htm/mdconkeysetcursors.asp Why are you using keysets at all? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Scripting

2005-01-22 Thread Robert Brewer
pdate > a web-page? If the file is local: open(filename, 'w').write(content) If the file is remote and you need to upload it via ftp, check out the ftplib module in the standard library, for starters. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Dejavu 1.3, a Python ORM

2005-01-20 Thread Robert Brewer
welcomes framework developers. New code for additional Storage Managers, analysis tools, or other portions will be gladly reviewed for inclusion in future releases. Drop me an email if you feel so inclined. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

QOTW from Ryan Tomayko

2005-01-20 Thread Robert Brewer
http://naeblis.cx/rtomayko/2005/01/20/getters-setters-fuxors "...Many people coming to Python can't believe no one uses IDEs. The automatic assumption is that Python is for old grey beards who are comfortable with vi and Emacs and refuse to accept breakthroughs in programming productivity like IDE

RE: Solutions for data storage?

2005-01-20 Thread Robert Brewer
Leif K-Brooks wrote: > Robert Brewer wrote: > > Try svn://casadeamor.com/dejavu/trunk if you want a truly > Pythonic query > > syntax. Wait a couple of days, and I'll have version 1.3 ready and > > online at http://www.aminus.org/rbre/python -- lots of changes from

RE: RuntimeError: dictionary changed size during iteration

2005-01-19 Thread Robert Brewer
e' changes that dictionary while you are iterating over it. Try either: [e for e in vars().keys()] or e = None [e for e in vars()] or the generator expression if you have Python 2.4. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Accessing MDB files on Windows

2005-01-19 Thread Robert Brewer
k? I'm not a Windows guy... :-) Use ADO unless you need to support older versions of Windows. It'll be a lot faster and cleaner than ODBC. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Solutions for data storage?

2005-01-19 Thread Robert Brewer
ouple of days, and I'll have version 1.3 ready and online at http://www.aminus.org/rbre/python -- lots of changes from 1.2.6 which is there now, but at least you can read old docs online now without svn. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: generator expressions: performance anomaly?

2005-01-18 Thread Robert Brewer
implementation time. So why bother? That's a horrid trade off > when there are so many other real gains to be had. Especially since you can already do it explicitly with Raymond Hettinger's cookbook recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 Robert Bre

RE: simultaneous multiple requests to very simple database

2005-01-18 Thread Robert Brewer
ry when records are written to. Just to clarify, you want shared-read until a write, at which point you want to lock just the item being written? Or would page or table locking be acceptable at that point? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: python to mssql

2005-01-14 Thread Robert Brewer
Brane wrote: > can someone please give me some info regarding subject http://sourceforge.net/projects/mysql-python Ask a broad question... Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: module on files & directories

2005-01-13 Thread Robert Brewer
ib/module-os.path.html>. I suspect you will also want to look at os.walk() eventually: for root, dirs, files in os.walk(path): for dir in dirs: do_something_with(dir) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: why are people still using classic classes?

2005-01-12 Thread Robert Brewer
Simon Wittber wrote: > Is there a legitimate use for classic classes that I am not aware of? As was pointed out to me when I asked on this list just a short while ago ;) classic classes can be faster. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listi

RE: Uploading files

2005-01-10 Thread Robert Brewer
filename = value.filename except AttributeError: filename = None if filename: # Store filename, filedata as a tuple. self.requestParams[key] = (filename, value.value) else: for subValue in form.getlist(key): self.requestParams[key] = su

RE: Writing huge Sets() to disk

2005-01-10 Thread Robert Brewer
Martin MOKREJŠ wrote: > Robert Brewer wrote: > > Martin MOKREJŠ wrote: > > > >> I have sets.Set() objects having up to 20E20 items, > >>each is composed of up to 20 characters. Keeping > >>them in memory on !GB machine put's me quickly into swap. &g

RE: Writing huge Sets() to disk

2005-01-10 Thread Robert Brewer
one as a value. The items in a set are unique. > > How can I write them efficiently to disk? got shelve*? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] * the "shelve" module in the standard library, that is. -- http://mail.python.org/mailman/listinfo/python-list

RE: there's a socket.sendall(), so why no socket.recvall()?

2005-01-08 Thread Robert Brewer
ng recvall would just duplicate that, I think. But that's desirable IMO. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Exception report library

2005-01-07 Thread Robert Brewer
. So, you could write WSGI consumers of them, but they wouldn't be WSGI-specific in my mind. If they were, they'd just add to the "several systems" you were lamenting... ;) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: switching an instance variable between a property and a normal value

2005-01-07 Thread Robert Brewer
_getitem__(self, key) def setdefaultvalue(self, value): self._default = value self._call_default = isinstance(value, ftypes) ...or: def setdefaultvalue(self, value, call_callables=True): self._default = value self._call_default = callable(value) and call_callables Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Exception report library

2005-01-07 Thread Robert Brewer
of startup/shutdown functions 6. Registry of active user interfaces I think the first three are all good candidates for a standard. If we had a standard, thread-safe Application object, the rest could be registerable plugins for that. You'd basically register callbacks for app.startup an

RE: switching an instance variable between a property and a normal value

2005-01-07 Thread Robert Brewer
_get__(self, obj, objtype=None): if obj is None: return self# Return whatever you like here if self.fget is None: raise AttributeError, "unreadable attribute" return self.fget(obj) That might be one way to get what you want. Robert Brewer MIS Amor Ministries [EMAIL

RE: Display Function Code Body?

2005-01-07 Thread Robert Brewer
You can do this with lambdas with my LambdaDecompiler inside: http://www.aminus.org/rbre/dejavu/codewalk.py If you want to extend it to full functions, be my guest. ;) There's also a commercial decompiler out there called "decompyle", and they even have a web service. http://www.crazy-co

RE: DOS problem (simple fix??)

2005-01-07 Thread Robert Brewer
t; > Thank you, and please make all answers simple enough to be understood > by a highschool student and his father :) . Even after all the IPO hype, the map integration, and the Suggest beta, Google is STILL your friend: http://www.google.com/search?q=windows+console+remain+open In other

RE: Pre/Postconditions with decorators

2005-01-06 Thread Robert Brewer
was just talking about @require decorators: http://blog.ianbicking.org/already-under-our-noses.html @require(int, int) def gcd(a, b): ... If we made a "checker" module for such things in the stdlib, we could write most of that: from checker import * @args((list, itemsno

RE: Bug in handling of single underscore identifiers?

2005-01-04 Thread Robert Brewer
>>> from path import sys Traceback (most recent call last): File "", line 1, in ? ImportError: No module named path In your example ("from _mechanoid_Common import Common"), import can't find any module named "_mechanoid_Common" in site-packages, PYTHONPATH, or other known sources. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda as declarative idiom

2005-01-04 Thread Robert Brewer
. Ditto for closures. A more realistic example: term = input("Enter the amount to add") e = expr(x): x + term ...MUCH code passes, maybe even a new process or thread... d = a + e(3) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Frameworks for "Non-Content Oriented Web Apps"

2005-01-02 Thread Robert Brewer
The big issue with leaving this question so generic is that the answers are legion. So I'll just keep it short and make my own shameless plug: try Cation for the Web interface and Dejavu for the data layer, both developed by yours truly. ;) http://www.aminus.org/rbre/python or... svn://c

Lambda as declarative idiom (was RE: what is lambda used for in real code?)

2004-12-31 Thread Robert Brewer
bdas for (even if I have to transform Python bytecode into another language to do it at the moment ;). Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Lambda going out of fashion

2004-12-23 Thread Robert Brewer
ambdas. That's been the only serious use case I've had for lambdas: a way to have an Expression object, in effect. If we had a more rigorous syntax specifically for first-class expressions, lambda could go away forever in my book. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED]

RE: Lambda going out of fashion

2004-12-23 Thread Robert Brewer
#x27;function as expression' look like? Or simply: accepts_func( (f(a) + o(b) - o(c) for a, b, c) ) ...but that would give whomever writes the parser a headache. ;) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Metaclasses

2004-12-23 Thread Robert Brewer
metaclass (or other solution) working, then go back to __private names if you want. At the moment, it's confusing the issue greatly. But why don't you just dynamically set attributes (like 'mode') instead of methods (like '_get_mode')? Will some of these be read-only? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Metaclasses

2004-12-22 Thread Robert Brewer
be to immediately follow your API class definition with a call like: from myframework import captools class API(object): def foo(): pass captools.enable(API) ...the choice comes down IMO to what you think will be the most usable/maintainable by those who follow you. Rob

RE: Metaclasses

2004-12-22 Thread Robert Brewer
attach methods to instances of API, then just do it in API.__init__(): class API(object): def __init__(self, keyring): for name, method in capabilities(keyring).iteritems(): setattr(self, name, method) Can you show us some code? <:) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: sql server support from linux

2004-12-21 Thread Robert Brewer
DB-API wrappers running on Win2k, how about doing that locally and then writing a quickie socket server which your linux client can connect to? Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: type method-wrapper?

2004-12-20 Thread Robert Brewer
/* ob_size */ "method-wrapper", /* tp_name */ Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: atmosphere on c.l.py (WAS: How about "pure virtual methods"?)

2004-12-19 Thread Robert Brewer
Fredrik Lundh wrote: > well, since I'm not in the ego-stroking business, what if I > promise never to > reply to posts by you, robert, and alex? ?? I'll take your replies anytime. You're a long way from all noise and no signal. I'm happy to learn what I can from

RE: atmosphere on c.l.py (WAS: How about "pure virtual methods"?)

2004-12-19 Thread Robert Brewer
answers, when not > attacks, are often very insightful. If you find a > good solution to this problem, please let me know. Wait; you mean there *isn't* a technological solution to every social issue? Bah. Guess I'll quit IT and go into marketing after all. ;) Robert Brewer MIS

RE: Cool object trick

2004-12-18 Thread Robert Brewer
Bengt Richter wrote: > >>> m=type('',(),{})() > >>> m.title = 'not so fast ;-)' > >>> m.title > 'not so fast ;-)' Now THAT is a cool object trick. :) FuManChu -- http://mail.python.org/mailman/listinfo/python-list

RE: expression form of one-to-many dict?

2004-12-17 Thread Robert Brewer
t.""" try: return dict.__getitem__(self, key) except KeyError: return [] def iterchains(self): """C.iterchains() -> an iterator over the (key, chain) pairs of C.""" return dict.iteritems(self) ...the one-liners flow effortlessly. ;) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Troubleshooting: re.finditer() creates object even when nomatch found

2004-12-17 Thread Robert Brewer
Chris Lasher wrote: > That's odd that there's no built-in method to do this. It seems like > it would be a common task. Is there any way to request a feature like > this from the RE module keepers, whomever they may be? The best way to request such a feature would be to write a patch. ;) FuManCh

RE: Cool object trick

2004-12-17 Thread Robert Brewer
#x27;m naively guessing you've got a typo. Feel free to correct me. ;) >>> class struct(object): ... def __init__(self, **kwargs): ... self.__dict__.update(kwargs) ... >>> var = "varA" >>> obj = struct(**{str(var): "Hello&qu

RE: Why no list heritable type?

2004-12-16 Thread Robert Brewer
James Stroud wrote: > The thread "why not arrays" got me thinking. I would really > like to inherit > from a list so that I can add methods based on its contents, > say if I filled > it with a type of object and wanted to iterate over all > objects. I have built > a wrapper around a list like

Dejavu 1.2.6, a Python ORM

2004-12-15 Thread Robert Brewer
red. Dejavu welcomes your use and feedback as an application developer. Dejavu also welcomes framework developers. New code for additional Storage Managers, analysis tools, will be gladly reviewed for inclusion in future releases. Drop me an email if you feel so inclined. Robert Brewer MIS Am

RE: PythonWin Not Updating

2004-12-14 Thread Robert Brewer
cs.python.org/lib/built-in-funcs.html Otherwise, you'll have to explain a bit more--that's my best guess as to what your issue is. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Robert Brewer
Terry Reedy wrote: > "Petr Prikryl" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >Summary: In my opinion, the C-like prefix > >increment and decrement operators (++i and --i) > > You could propose to the author of Pychecker that he include, > if possible, an option to check

RE: Iteration within re.sub()?

2004-12-13 Thread Robert Brewer
v.1200 32 bit (Intel)] on win32. >>> import re >>> s = "abbababbabbaaa" >>> i[0] = -1 >>> def sub(match): ... i[0] += 1 ... return str(i[0]) ... >>> re.sub("b", sub, s) 'a01a2a34a56aaa' Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Tibia 0.1 DOM-based website editor

2004-12-13 Thread Robert Brewer
; you only change to server mode when you actually load a file from the server. Numerous other buglets fixed over the weekend. Thanks for the feedback, all! Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >