changeset 949:c93f5999c08e

remove edit lock code (was not used and did not work anyway. needs to be done differently.)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 09 Oct 2011 15:54:22 +0200
parents 77ef4841b4f4
children 57ac61f78053
files MoinMoin/config/default.py MoinMoin/util/edit_lock.py
diffstat 2 files changed, 1 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/default.py	Sun Oct 09 15:45:31 2011 +0200
+++ b/MoinMoin/config/default.py	Sun Oct 09 15:54:22 2011 +0200
@@ -397,7 +397,7 @@
   # ==========================================================================
   'editor': ('Editor related', None, (
     ('item_license', u'', 'if set, show the license item within the editor. [Unicode]'),
-    ('edit_locking', 'warn 10', "Editor locking policy: `None`, `'warn <timeout in minutes>'`, or `'lock <timeout in minutes>'`"),
+    #('edit_locking', 'warn 10', "Editor locking policy: `None`, `'warn <timeout in minutes>'`, or `'lock <timeout in minutes>'`"),
     ('edit_ticketing', True, None),
   )),
   # ==========================================================================
--- a/MoinMoin/util/edit_lock.py	Sun Oct 09 15:45:31 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-# Copyright: 2006-2011 The MoinMoin development team
-# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
-
-"""
-    MoinMoin - Edit Locking
-"""
-
-
-EDIT_LOCK_TIMESTAMP = "edit_lock_timestamp"
-EDIT_LOCK_ADDR = "edit_lock_addr"
-EDIT_LOCK_HOSTNAME = "edit_lock_hostname"
-EDIT_LOCK_USERID = "edit_lock_userid"
-
-EDIT_LOCK = (EDIT_LOCK_TIMESTAMP, EDIT_LOCK_ADDR, EDIT_LOCK_HOSTNAME, EDIT_LOCK_USERID)
-
-def get_edit_lock(item):
-    """
-    Given an Item, get a tuple containing the timestamp of the edit-lock and the user.
-    """
-    for key in EDIT_LOCK:
-        if not key in item:
-            return (False, 0.0, "", u"", "")
-        else:
-            return (True, float(item[EDIT_LOCK_TIMESTAMP]), item[EDIT_LOCK_ADDR],
-                    item[EDIT_LOCK_HOSTNAME], item[EDIT_LOCK_USERID])
-
-def set_edit_lock(item):
-    """
-    Set the lock property to True or False.
-    """
-    timestamp = time.time()
-    addr = request.remote_addr
-    hostname = wikiutil.get_hostname(addr) or u''
-    userid = flaskg.user.valid and flaskg.user.itemid or ''
-
-    item.change_metadata()
-    item[EDIT_LOCK_TIMESTAMP] = str(timestamp)
-    item[EDIT_LOCK_ADDR] = addr
-    item[EDIT_LOCK_HOSTNAME] = hostname
-    item[EDIT_LOCK_USERID] = userid
-    item.publish_metadata()
-
-