From a26c2035f895f329fd7d2a8892b7606be0d46116 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Mon, 26 Oct 2009 03:15:57 +0000 Subject: [PATCH] Bug fixes and cleanups --- sfatables/commands/Add.py | 9 ++++----- sfatables/processors/link/restrict_slice.xml | 3 ++- sfatables/processors/max_link_bandwidth.xsl | 3 ++- sfatables/processors/restrict_to_nodes.xsl | 5 +++-- sfatables/test.sfarspec | 8 ++++++++ sfatables/xmlrule.py | 8 +++++--- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/sfatables/commands/Add.py b/sfatables/commands/Add.py index da02e869..c6f89a88 100644 --- a/sfatables/commands/Add.py +++ b/sfatables/commands/Add.py @@ -4,12 +4,11 @@ from sfatables.command import Command from sfatables.globals import * class Add(Command): - options = [('-A','--add')] - help = 'Add a rule to a chain' - matches = True - targets = True - def __init__(self): + self.options = [('-A','--add')] + self.help = 'Add a rule to a chain' + self.matches = True + self.targets = True return def getnextfilename(self,type,chain): diff --git a/sfatables/processors/link/restrict_slice.xml b/sfatables/processors/link/restrict_slice.xml index 37c56d46..ee641cca 100644 --- a/sfatables/processors/link/restrict_slice.xml +++ b/sfatables/processors/link/restrict_slice.xml @@ -11,7 +11,7 @@ - + @@ -25,3 +25,4 @@ +> diff --git a/sfatables/processors/max_link_bandwidth.xsl b/sfatables/processors/max_link_bandwidth.xsl index 37c56d46..ee641cca 100644 --- a/sfatables/processors/max_link_bandwidth.xsl +++ b/sfatables/processors/max_link_bandwidth.xsl @@ -11,7 +11,7 @@ - + @@ -25,3 +25,4 @@ +> diff --git a/sfatables/processors/restrict_to_nodes.xsl b/sfatables/processors/restrict_to_nodes.xsl index f09a56fe..492e383d 100644 --- a/sfatables/processors/restrict_to_nodes.xsl +++ b/sfatables/processors/restrict_to_nodes.xsl @@ -9,8 +9,8 @@ - - + + @@ -23,3 +23,4 @@ +et> diff --git a/sfatables/test.sfarspec b/sfatables/test.sfarspec index 5a3a36bd..ec9c3626 100644 --- a/sfatables/test.sfarspec +++ b/sfatables/test.sfarspec @@ -5,6 +5,13 @@ plc.princeton.sapanb + + + blacklist + plc.tp + + + @@ -15,3 +22,4 @@ +ec> diff --git a/sfatables/xmlrule.py b/sfatables/xmlrule.py index 58a8d4cc..b700b60d 100644 --- a/sfatables/xmlrule.py +++ b/sfatables/xmlrule.py @@ -42,11 +42,13 @@ class XMLRule: style = libxslt.parseStylesheetDoc(styledoc) #doc = libxml2.parseDoc(rspec) result = style.applyStylesheet(doc, None) - stylesheet_result = result #style.saveResultToString(result) + stylesheet_result = style.saveResultToString(result) style.freeStylesheet() - #doc.freeDoc() - #result.freeDoc() + doc.freeDoc() + result.freeDoc() + import pdb + pdb.set_trace() return stylesheet_result def match(self, rspec): -- 2.43.0