blooper avatar blooper committed 938b5a5

Fix the way to access class variables

Comments (0)

Files changed (1)

     self.arrows = set()
 
   def add(self, x509):
-    cls = self.__class__
     issuers = self.cadb.issuers_of(x509)
     if issuers:
       d = x509.as_dict()
       issuer_hash = hash_of(d['issuer']).hexdigest()
       self.arrows.add("E%s -> E%s [label=\"%s\" color=\"%s\"]" % (
         issuer_hash, x509_hash,
-        arrow_label, cls.sign_color[d['signatureAlgorithm']]))
+        arrow_label, self.sign_color[d['signatureAlgorithm']]))
 
   def _add_node(self, x509):
-    cls = self.__class__
     d = x509.as_dict()
 
     subject_hash = hash_of(d['subject']).hexdigest()
     for i in range(102):
       entries = x509.get_subject().get_entries_by_nid(i)
       if entries:
-        rdn.append("%s: " % (cls.nid[i],)
+        rdn.append("%s: " % (self.nid[i],)
           + ", ".join(map(lambda x: x.get_data().as_text(), entries)))
     node_label = '\\n'.join(rdn)
 
     node = "E%s [label=\"%s\", fillcolor=\"%s\"]" % (
-      subject_hash, node_label, cls.key_color[d['keyLength']])
+      subject_hash, node_label, self.key_color[d['keyLength']])
 
     group = 'others'
-    for name, regex in cls.r_subgraphs.items():
+    for name, regex in self.r_subgraphs.items():
       if regex.search(d['issuer']):
         group = name
         break
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.