示例#1
0
文件: dxfpp.py 项目: csachs/ezdxf
def tag_type_str(code):
    if code in GROUP_MARKERS:
        return '<ctrl>'
    elif code in HEX_HANDLE_CODES:
        return '<hex>'
    elif 309 < code < 320:
        return '<bin>'
    else:
        return TAG_TYPES[tag_type(code)]
示例#2
0
文件: dxfpp.py 项目: soldocode/ezdxf
def tag_type_str(code):
    if code in GROUP_MARKERS:
        return '<ctrl>'
    elif code in HEX_HANDLE_CODES:
        return '<hex>'
    elif is_point_code(code):
        return '<point>'
    elif is_binary_data(code):
        return '<bin>'
    else:
        return TAG_TYPES[tag_type(code)]
示例#3
0
    def _match(self, code: int, value: Any) -> bool:
        if tag_type(code) is not str:
            if not self.numbers:
                return False
            value = str(value)

        if self.case_insensitive:
            search_term = self._search_term_lower
            value = value.lower()
        else:
            search_term = self._search_term

        if self.whole_words:
            return any(search_term == word for word in value.split())
        else:
            return search_term in value
示例#4
0
文件: test_tags.py 项目: csachs/ezdxf
 def test_str(self):
     self.assertEqual(ustr, tag_type(0))
示例#5
0
文件: test_tags.py 项目: csachs/ezdxf
 def test_float(self):
     self.assertEqual(point_tuple, tag_type(10))
示例#6
0
文件: test_tags.py 项目: csachs/ezdxf
 def test_int(self):
     self.assertEqual(int, tag_type(60))
示例#7
0
 def test_str(self):
     assert ustr is tag_type(0)
示例#8
0
 def test_float(self):
     assert point_tuple is tag_type(10)
示例#9
0
 def test_int(self):
     assert int is tag_type(60)
示例#10
0
 def test_value_error(self):
     with self.assertRaises(ValueError):
         tag_type(3000)
示例#11
0
def tag_type_str(code):
    if 309 < code < 320:
        return '<bin>'
    else:
        return TAG_TYPES[tag_type(code)]
示例#12
0
def tag_type_str(code):
    if 309 < code < 320:
        return '<bin>'
    else:
        return TAG_TYPES[tag_type(code)]