Opened 17 years ago

Last modified 17 years ago

#291 defect closed fixed (fixed)

app.getApplication cleanup

Reported by: enki Owned by:
Priority: high Milestone:
Component: Keywords:
Cc: enki Branch:
Author:

Description


Change History (5)

comment:1 Changed 17 years ago by enki

Index: app.py
===================================================================
RCS file: /cvs/Twisted/twisted/application/app.py,v
retrieving revision 1.3
diff -u -r1.3 app.py
--- app.py  21 Sep 2003 01:07:23 -0000  1.3
+++ app.py  27 Sep 2003 22:16:16 -0000
@@ -81,9 +81,14 @@
         return None

 def getApplication(config, passphrase):
-    s = [(config[t], t)
-           for t in ['python', 'xml', 'source', 'file'] if config[t]][0]
-    filename, style = s[0], {'file':'pickle'}.get(s[1],s[1])
+    for t in ['python', 'xml', 'source', 'file', 'tapdir', None]:
+        style = t
+        filename = config[style]
+        if filename:
+            break
+    if style == 'file':
+        style = 'pickle'
+
     try:
         log.msg("Loading %s..." % filename)
         application = service.loadApplication(filename, style, passphrase)

comment:2 Changed 17 years ago by Moshe Zadka

I'm going to reject it -- this code works, and is clear 
enough. Do you have any good reason, other than clean-up, 
for this patch?

comment:3 Changed 17 years ago by enki

On Tue, Sep 30, 2003 at 05:40:22AM +0000, Moshe Zadka wrote:
> I'm going to reject it -- this code works, and is clear 
> enough. Do you have any good reason, other than clean-up, 
> for this patch?

no
besides i've joined the dark circle now and understand the code anyway,
lets keep those pesty newbies away from the secrets of the inner circle!

comment:4 Changed 17 years ago by Moshe Zadka

patch rejected

comment:5 Changed 9 years ago by <automation>

Note: See TracTickets for help on using tickets.