Package: luma
Version: 2.4-2
Severity: normal
Tags: patch

Hi,

the schema browser in luma 2.4-2 makes too little error checks on the
schema data leading to exceptions like the following:

  16:38:16   An unhandled exception occured. This is most likely a bug 
  in the programming of Luma. In order to fix this, send an email with the 
  following text and a detailed description of what you were doing to
  luma-us...@lists.sourceforge.net.
    File "/usr/lib/luma/plugins/schemabrowser/SchemaView.py", line 208, in 
attributeSelected
      self.equalityAttributeEdit.setText(attributeDataDict['EQUALITY'])
  Reason: <type 'exceptions.TypeError'> argument 1 of QLineEdit.setText() has 
an invalid type

The attached patch fixes these issues.

In full detail, the patch fixes the following issues:
- show all SUP objectclasses, instead of only the first one
  (LDAP allows multiple objectclass inheritance)
- show all parent attributetypes, instead of only the first one
  (don't know if that can occur, but the code was there ;-)
- allow EQUALITY matching rule to be missing
- allow ORDERING matching rule to be missing
  (matching rules are optional in LDAP)
- allow SYNTAX OID to be missing
  (e.g. on attribute types that inherit from superior

Thanks for maintaining luma in Debian
Peter


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages luma depends on:
ii  python                        2.5.4-4    An interactive high-level object-o
ii  python-ldap                   2.3.10-1   LDAP interface module for Python
ii  python-qt3                    3.18.1-2   Qt3 bindings for Python
ii  python-support                1.0.6      automated rebuilding support for P

luma recommends no packages.

luma suggests no packages.

-- no debconf information
#! /bin/sh /usr/share/dpatch/dpatch-run
## luma-2.4-schemaview.patch
## DP: fix a few errors in schema viewer
# From: Peter Marschall <pe...@adpm.de>
# Subject: fix a few errors in schema viewer


--- luma-2.4/lib/luma/plugins/schemabrowser/SchemaView.py
+++ luma-2.4/lib/luma/plugins/schemabrowser/SchemaView.py
@@ -166,7 +166,7 @@ class SchemaView(SchemaViewDesign):
         self.classLabel.setText(labelString)
         
         if len(classDataDict['PARENTS']) > 0:
-            self.superiorClassEdit.setText(classDataDict['PARENTS'][0])
+            self.superiorClassEdit.setText(", ".join(classDataDict['PARENTS']))
             
         self.oidClassEdit.setText(classDataDict['OID'])
         self.kindClassEdit.setText(classDataDict['KIND'])
@@ -199,23 +199,26 @@ class SchemaView(SchemaViewDesign):
             self.attributeLabel.setText(labelString)
         
         if len(attributeDataDict['SUP']) > 0:
-            self.superiorAttributeEdit.setText(attributeDataDict['SUP'][0])
+            self.superiorAttributeEdit.setText(", ".join(attributeDataDict['SUP']))
             
         self.oidAttributeEdit.setText(attributeDataDict['OID'])
         
         usageValue = attributeDataDict['USAGE']
         self.usageAttributeEdit.setText(self.usageDict[usageValue])
-        self.equalityAttributeEdit.setText(attributeDataDict['EQUALITY'])
+        if None != attributeDataDict['EQUALITY']:
+            self.equalityAttributeEdit.setText(attributeDataDict['EQUALITY'])
         
         syntaxLen = attributeDataDict['SYNTAX_LEN']
         if None == syntaxLen:
             syntaxString = attributeDataDict['SYNTAX']
-            self.syntaxAttributeEdit.setText(syntaxString)
+            if syntaxString:
+                self.syntaxAttributeEdit.setText(syntaxString)
         else:
             syntaxString = attributeDataDict['SYNTAX'] + "{" + str(syntaxLen) + "}"
             self.syntaxAttributeEdit.setText(syntaxString)
         
-        self.orderingAttributeEdit.setText(attributeDataDict['ORDERING'])
+        if None != attributeDataDict['ORDERING']:
+            self.orderingAttributeEdit.setText(attributeDataDict['ORDERING'])
         self.singleAttributeBox.setOn(attributeDataDict['SINGLE'])
         self.collectiveAttributeBox.setOn(attributeDataDict['COLLECTIVE'])
         self.obsoleteAttributeBox.setOn(attributeDataDict['OBSOLETE'])

Reply via email to