News for hackers. Stuff that matters.
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by btw0 on Thursday August 27, 2009 @11:32PM (#790688)
From the author's homepage, this is a project of 2006, seems that it hasn't changed for 3 years.
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by ggruschow on Friday August 28, 2009 @08:10AM (#791203)
Is code that hasn't changed in a long time stigmatized? If so, is it an assumption that all code is broken and needs to be changed regularly?
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by mahmud on Friday August 28, 2009 @04:31PM (#792225)
1) "if it's been around that long, why hasn't it caught on with more people? is there a problem with it?"

2) "if I face a problem with it, will the author help me debug it for fix it?"

3) "if the last changes to this software were made X years ago, how does it apply the number of industry practices and techniques that have been developed since then?"

Re:Scratch.py -- hyper-fast mini-webapp production, in Python by brodie on Thursday August 27, 2009 @11:43PM (#790693)
It'd be interesting to see something like this that uses Python 3's function annotations.

  def greetings(ladies: int, gentlemen: (int, 80, 40)): pass
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by troels on Friday August 28, 2009 @07:12AM (#791148)
> Note that when you specify field width & height w/ _80 or _40_20 (or whatever,) that you have to change the variable use within the code, too... Real bummer, hunh? I know.

Encoding presentation code into the controller layer seems like a bad idea in my mind. Besides being ugly to look at.

Re:Scratch.py -- hyper-fast mini-webapp production, in Python by randallsquared on Friday August 28, 2009 @09:14AM (#791284)
For a proof-of-concept that you expect to throw away when you start on a real version, things can be sacrificed to speed. But it is ugly, I'll agree.
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by rogeriopvl on Friday August 28, 2009 @04:11AM (#790999)
Tried it in OS X, and the web server crashed on first request. I'll try it later on linux. Either way, it's an interesting prototyping tool.
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by cturner on Friday August 28, 2009 @05:37AM (#791082)
Happens on osx, linux, win32 for me.

Quick workaround (this is the first time I've ever sent out a patch. heh)

    --- scratch.py.original 2009-08-28 10:49:38.000000000 +0100
    +++ scratch.py  2009-08-28 10:42:17.000000000 +0100
    @@ -213,10 +213,13 @@

         def one_line_description(self):
             """DOC"""
    -        if len(self.mod.__doc__) > 0:
    -            return self.mod.__doc__.splitlines()[0]
    -        else:
    -            return "(no description)"
    +        try:
    +            if len(self.mod.__doc__) > 0:
    +                return self.mod.__doc__.splitlines()[0]
    +            else:
    +                return "(no description)"
    +        except:
    +            return "(no description)"

         def long_description(self):
             """DOC"""
Save that to a file called scratch.patch (make sure there's no indentation at the beginning of lines) in the dir. Then run this:

    patch < ../scratch.patch
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by LionKimbro on Saturday August 29, 2009 @02:22AM (#792871)
OK; I've applied the fix to the master. Thank you!
Re:Scratch.py -- hyper-fast mini-webapp production, in Python by mcav on Thursday August 27, 2009 @11:08PM (#790659)
Cool. The naming conventions might get unruly for very tiny projects, but definitely an interesting piece of work.