#############################################################################
#  File:    geoparse.py                                                     #
#  Author:  Velimir Mlaker, mlaker1@llnl.gov                                #
#  Date:    05-Aug-2005                                                     #
#  Desc:    Parsers for geometry string.                                    #
#           KNOWN BUG: Only works on form wxh+x+y, i.e. with '+' for x and  #
#                      y coords. It will fail if using '-' for x and y.     #
#############################################################################

# Extract width from the geometry string.
def get_w (geo):
    return geo [:geo.find('x')]

# Extract height from the geometry string.
def get_h (geo):
    return geo [geo.find('x')+1 : geo.find('+')]

# Extract X and Y from the geometry string.
def get_xy (geo):
    return geo [geo.find('+')+1 : len(geo)]

# Extract X from the geometry string.
def get_x (geo):
    xy = get_xy(geo)
    return xy [:xy.find('+')]

# Extract Y from the geometry string.
def get_y (geo):
    xy = get_xy(geo)
    return xy [xy.find('+')+1 : len(xy)]

3887e47d266aa37eeacf4a8d0fe2ecb63c05ffc8
<mask token>


def get_xy(geo):
    return geo[geo.find('+') + 1:len(geo)]


def get_x(geo):
    xy = get_xy(geo)
    return xy[:xy.find('+')]


<mask token>

def get_w(geo):
    return geo[:geo.find('x')]


<mask token>


def get_xy(geo):
    return geo[geo.find('+') + 1:len(geo)]


def get_x(geo):
    xy = get_xy(geo)
    return xy[:xy.find('+')]


<mask token>

def get_w(geo):
    return geo[:geo.find('x')]


<mask token>


def get_xy(geo):
    return geo[geo.find('+') + 1:len(geo)]


def get_x(geo):
    xy = get_xy(geo)
    return xy[:xy.find('+')]


def get_y(geo):
    xy = get_xy(geo)
    return xy[xy.find('+') + 1:len(xy)]

def get_w(geo):
    return geo[:geo.find('x')]


def get_h(geo):
    return geo[geo.find('x') + 1:geo.find('+')]


def get_xy(geo):
    return geo[geo.find('+') + 1:len(geo)]


def get_x(geo):
    xy = get_xy(geo)
    return xy[:xy.find('+')]


def get_y(geo):
    xy = get_xy(geo)
    return xy[xy.find('+') + 1:len(xy)]

#############################################################################
#  File:    geoparse.py                                                     #
#  Author:  Velimir Mlaker, mlaker1@llnl.gov                                #
#  Date:    05-Aug-2005                                                     #
#  Desc:    Parsers for geometry string.                                    #
#           KNOWN BUG: Only works on form wxh+x+y, i.e. with '+' for x and  #
#                      y coords. It will fail if using '-' for x and y.     #
#############################################################################

# Extract width from the geometry string.
def get_w (geo):
    return geo [:geo.find('x')]

# Extract height from the geometry string.
def get_h (geo):
    return geo [geo.find('x')+1 : geo.find('+')]

# Extract X and Y from the geometry string.
def get_xy (geo):
    return geo [geo.find('+')+1 : len(geo)]

# Extract X from the geometry string.
def get_x (geo):
    xy = get_xy(geo)
    return xy [:xy.find('+')]

# Extract Y from the geometry string.
def get_y (geo):
    xy = get_xy(geo)
    return xy [xy.find('+')+1 : len(xy)]
