mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 11:54:50 +00:00 
			
		
		
		
	Add a rich horizontal rule print on Service construction
This commit is contained in:
		
							parent
							
								
									e9b3b3a588
								
							
						
					
					
						commit
						178bd01069
					
				@ -8,6 +8,8 @@ from urllib.parse import urlparse
 | 
			
		||||
import click
 | 
			
		||||
import requests
 | 
			
		||||
from requests.adapters import HTTPAdapter, Retry
 | 
			
		||||
from rich.padding import Padding
 | 
			
		||||
from rich.rule import Rule
 | 
			
		||||
 | 
			
		||||
from devine.core.cacher import Cacher
 | 
			
		||||
from devine.core.config import config
 | 
			
		||||
@ -27,6 +29,11 @@ class Service(metaclass=ABCMeta):
 | 
			
		||||
    GEOFENCE: tuple[str, ...] = ()  # list of ip regions required to use the service. empty list == no specific region.
 | 
			
		||||
 | 
			
		||||
    def __init__(self, ctx: click.Context):
 | 
			
		||||
        console.print(Padding(
 | 
			
		||||
            Rule(f"[rule.text]Service: {self.__class__.__name__}"),
 | 
			
		||||
            (1, 2)
 | 
			
		||||
        ))
 | 
			
		||||
 | 
			
		||||
        self.config = ctx.obj.config
 | 
			
		||||
 | 
			
		||||
        self.log = logging.getLogger(self.__class__.__name__)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user