<commit_before>#! /usr/bin/env python

import sys
from sfa.util.rspecHelper import RSpec, Commands

command = Commands(usage="%prog [options] node1 node2...",
                   description="Delete slivers from the RSpec. " +
                   "This command reads in an RSpec and outputs a modified " +
                   "RSpec. Use this to remove nodes from your slice.")
command.add_nodefile_option()
command.prep()

for node in command.nodes:
    try:
        command.rspec.remove_sliver(node)
    except:
        print >> sys.stderr, "FAILED: %s" % node

print command.rspec
    

    <commit_msg>now uses new RSpec libraries<commit_after>#! /usr/bin/env python

import sys
from sfa.client.sfi_commands import Commands
from sfa.rspecs.rspec_parser import parse_rspec

command = Commands(usage="%prog [options] node1 node2...",
                   description="Delete slivers from the RSpec. " +
                   "This command reads in an RSpec and outputs a modified " +
                   "RSpec. Use this to remove nodes from your slice.")
command.add_nodefile_option()
command.prep()

if command.opts.infile:
    rspec = parse_rspec(command.opts.infile)
    nodes = []
    if command.opts.nodefile:
        f = open(command.opts.nodefile, "r")
        nodes = f.read().split()
        f.close()
       
        try:
            rspec.remove_slivers(nodes)
        except:
            print >> sys.stderr, "FAILED: %s"  

    print rspec.toxml()
    

    
{'fraction_non_alphanumeric': 0.10307167235494881, 'fraction_numerical': 0.0027303754266211604, 'mean_word_length': 2.279642058165548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7294321', 'n_tokens_mistral': 452, 'n_tokens_neox': 444, 'n_words': 125}