mirror of
				https://github.com/qurator-spk/modstool.git
				synced 2025-11-04 03:14:14 +01:00 
			
		
		
		
	🤓 Add type annotations (and related changes)
This commit is contained in:
		
							parent
							
								
									580442a4c9
								
							
						
					
					
						commit
						62b93c760b
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -114,9 +114,8 @@ class TagGroup:
 | 
			
		|||
                warnings.warn('Added iso8601 encoding to date {}'.format(e.text))
 | 
			
		||||
                e.attrib['encoding'] = 'iso8601'
 | 
			
		||||
                new_group.append(e)
 | 
			
		||||
            elif re.match(self.RE_GERMAN_DATE, e.text):
 | 
			
		||||
            elif m := re.match(self.RE_GERMAN_DATE, e.text):
 | 
			
		||||
                warnings.warn('Converted date {} to iso8601 encoding'.format(e.text))
 | 
			
		||||
                m = re.match(self.RE_GERMAN_DATE, e.text)
 | 
			
		||||
                e.text = '{}-{}-{}'.format(m.group('yyyy'), m.group('mm'), m.group('dd'))
 | 
			
		||||
                e.attrib['encoding'] = 'iso8601'
 | 
			
		||||
                new_group.append(e)
 | 
			
		||||
| 
						 | 
				
			
			@ -210,7 +209,7 @@ class TagGroup:
 | 
			
		|||
        return attrib
 | 
			
		||||
 | 
			
		||||
    def subelement_counts(self) -> dict[str, int]:
 | 
			
		||||
        counts = {}
 | 
			
		||||
        counts: dict[str, int] = {}
 | 
			
		||||
        for e in self.group:
 | 
			
		||||
            for x in e.iter():
 | 
			
		||||
                tag = ET.QName(x.tag).localname
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue