Commits

jonas  committed 05c24cc

Code cleanup

  • Participants
  • Parent commits ee721b6
  • Branches trunk

Comments (0)

Files changed (1)

File svntrac/Wiki.py

     template_name = 'wiki.template'
 
     def render(self):
-        if self.args.has_key('page'):
-            name = self.args['page']
-        else:
-            name = 'WikiStart'
-        if self.args.has_key('version'):
-            version = self.args['version']
-        else:
-            version = 0
-            
-        if self.args.has_key('action'):
-            action = self.args['action']
-        else:
-            action = 'view'
+        name = dict_get_with_default(self.args, 'page', 'WikiStart')
+        action = dict_get_with_default(self.args, 'action', 'view')
+        version = dict_get_with_default(self.args, 'verion', 0)
             
         page = Page(name, version)
 
         self.namespace['content'] = out.getvalue()
 
 
+###
+### A simple unit test
+###
+
 test_in = '''
  * Foo
    * Foo 2