# Path: nord/nm2g2.py
# class NM2G2Converter:
#   def __init__(self, pchfilename, options, log):
#   def convert(self):
#   def doarea(self, nmarea, g2area):
#   def doconverters(self, nmarea, g2area):
#   def domodules(self, converters):
#   def docolorizemultis(self, converters):
#   def dogroups(self, converters):
#   def doreposition(self, converters):
#     def locationcmp(a, b):
#   def doprecables(self, converters):
#   def docables(self, nmarea, g2area):
#   def douprate(self, g2area):
#   def dologiccombine(self, g2area):
#     def locationcmp(a, b):
#     def gateused(gate, num):
#     def freegate(gate):
#     def usedgate(gate):
#     def invertused(invert, num):
#     def freeinvert(invert):
#     def usedinvert(invert):
#     def makepairs(shortnm, freelogic):
#     def movecable(g2area, fromconn, toconn):
#   def cablerecolorize(self, g2area):
#   def docableshorten(self, g2area):
#   def domorphs(self):
#     def find_unused():
#   def doknobs(self):
#   def domidiccs(self):
#   def docurrentnotes(self):
#   def dofinalize(self):
#   def dotitleblock(self):
#     def addnamebars(lines, horiz, vert):


import logging
import os, sys, time, traceback
from optparse import OptionParser, make_option
from glob import glob
from nord.nm2g2 import NM2G2Converter, NM1Error
      help='Turn off shorten cable connections'),
  make_option('-v', '--verbose', action='store',
      dest='verbosity', default='2', choices=map(str, range(5)),
      help='Set converter verbosity level 0-4'),
]

def doconvert(filename, options):
  # general algorithm for converter:
  try:
    nm2g2 = NM2G2Converter(filename, options, options.log)
    nm2g2.convert()
  except KeyboardInterrupt:
    sys.exit(1)
  except NM1Error, s:
    return '%s\n%s' % (filename, s)
  except Exception, e:
    if options.debug:
      return '%s\n%s' % (filename, traceback.format_exc())
    else:
      return '%s\n%s' % (filename, e)
  return ''

def process_file(filename, options):
  if filename[-5:].lower() == '.pch2':
    return
  if filename[-4:].lower() == '.pch' or options.allfiles:
    testname = filename
    if filename[-4:].lower() != '.pch':
      testname = filename+'.pch'
    if options.keepold and os.path.exists(testname + '2'):

# Path: nord/nm2g2.py
# class NM2G2Converter:
#   def __init__(self, pchfilename, options, log):
#   def convert(self):
#   def doarea(self, nmarea, g2area):
#   def doconverters(self, nmarea, g2area):
#   def domodules(self, converters):
#   def docolorizemultis(self, converters):
#   def dogroups(self, converters):
#   def doreposition(self, converters):
#     def locationcmp(a, b):
#   def doprecables(self, converters):
#   def docables(self, nmarea, g2area):
#   def douprate(self, g2area):
#   def dologiccombine(self, g2area):
#     def locationcmp(a, b):
#     def gateused(gate, num):
#     def freegate(gate):
#     def usedgate(gate):
#     def invertused(invert, num):
#     def freeinvert(invert):
#     def usedinvert(invert):
#     def makepairs(shortnm, freelogic):
#     def movecable(g2area, fromconn, toconn):
#   def cablerecolorize(self, g2area):
#   def docableshorten(self, g2area):
#   def domorphs(self):
#     def find_unused():
#   def doknobs(self):
#   def domidiccs(self):
#   def docurrentnotes(self):
#   def dofinalize(self):
#   def dotitleblock(self):
#     def addnamebars(lines, horiz, vert):


# Path: nm2g2.py
import logging
import os, sys, time, traceback
from optparse import OptionParser, make_option
from glob import glob
from nord.nm2g2 import NM2G2Converter, NM1Error

      help='Turn off shorten cable connections'),
  make_option('-v', '--verbose', action='store',
      dest='verbosity', default='2', choices=map(str, range(5)),
      help='Set converter verbosity level 0-4'),
]

def doconvert(filename, options):
  # general algorithm for converter:
  try:
    nm2g2 = NM2G2Converter(filename, options, options.log)
    nm2g2.convert()
  except KeyboardInterrupt:
    sys.exit(1)
  except NM1Error, s:
    return '%s\n%s' % (filename, s)
  except Exception, e:
    if options.debug:
      return '%s\n%s' % (filename, traceback.format_exc())
    else:
      return '%s\n%s' % (filename, e)
  return ''

def process_file(filename, options):
  if filename[-5:].lower() == '.pch2':
    return
  if filename[-4:].lower() == '.pch' or options.allfiles:
    testname = filename
    if filename[-4:].lower() != '.pch':
      testname = filename+'.pch'
    if options.keepold and os.path.exists(testname + '2'):

      return