예제 #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')
예제 #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')
예제 #3
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
예제 #4
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
예제 #5
0
파일: excelio.py 프로젝트: fumitoh/modelx
    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")