Exemplo n.º 1
0
 def destinations(self):
     if self.type == "RANGE":
         tok = Tokenizer("=" + self.value)
         for part in tok.items:
             if part.subtype == "RANGE":
                 m = SHEETRANGE_RE.match(part.value)
                 yield m.group('notquoted'), m.group('cells')
Exemplo n.º 2
0
 def destinations(self):
     if self.type == "RANGE":
         tok = Tokenizer("=" + self.value)
         for part in tok.items:
             if part.subtype == "RANGE":
                 m = SHEETRANGE_RE.match(part.value)
                 yield m.group('notquoted'), m.group('cells')
Exemplo n.º 3
0
def _unpack_print_area(defn):
    """
    Extract print area
    """
    new = []
    for m in SHEETRANGE_RE.finditer(defn.value):  # can be multiple
        coord = m.group("cells")
        if coord:
            new.append(coord)
    return new
Exemplo n.º 4
0
def _unpack_print_area(defn):
    """
    Extract print area
    """
    new = []
    for m in SHEETRANGE_RE.finditer(defn.value): # can be multiple
        coord = m.group("cells")
        if coord:
            new.append(coord)
    return new
Exemplo n.º 5
0
def _unpack_print_area(defn):
    """
    Extract print area
    """
    ranges = defn.value.split(",") # can be multiple
    new = []
    for r in ranges:
        m = SHEETRANGE_RE.match(r)
        new.append(m.group('cells'))
    return new
Exemplo n.º 6
0
def _unpack_print_area(defn):
    """
    Extract print area
    """
    ranges = defn.value.split(",")  # can be multiple
    new = []
    for r in ranges:
        m = SHEETRANGE_RE.match(r)
        new.append(m.group('cells'))
    return new
Exemplo n.º 7
0
    def get_destinations(name_def):
        """Workaround for the bug in DefinedName.destinations"""

        from openpyxl.formula import Tokenizer
        from openpyxl.utils.cell import SHEETRANGE_RE

        if name_def.type == "RANGE":
            tok = Tokenizer("=" + name_def.value)
            for part in tok.items:
                if part.subtype == "RANGE":
                    m = SHEETRANGE_RE.match(part.value)
                    if m.group("quoted"):
                        sheet_name = m.group("quoted")
                    else:
                        sheet_name = m.group("notquoted")

                    yield sheet_name, m.group("cells")