Coverage for sources/emcdproj/__/application.py: 100%
11 statements
« prev ^ index » next coverage.py v7.8.2, created at 2025-05-29 22:13 +0000
« prev ^ index » next coverage.py v7.8.2, created at 2025-05-29 22:13 +0000
1# vim: set filetype=python fileencoding=utf-8:
2# -*- coding: utf-8 -*-
4#============================================================================#
5# #
6# Licensed under the Apache License, Version 2.0 (the "License"); #
7# you may not use this file except in compliance with the License. #
8# You may obtain a copy of the License at #
9# #
10# http://www.apache.org/licenses/LICENSE-2.0 #
11# #
12# Unless required by applicable law or agreed to in writing, software #
13# distributed under the License is distributed on an "AS IS" BASIS, #
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15# See the License for the specific language governing permissions and #
16# limitations under the License. #
17# #
18#============================================================================#
21''' Information about application. '''
24from . import imports as __
25from . import nomina as _nomina
28class Information( metaclass = __.ImmutableDataclass ):
29 ''' Information about an application. '''
31 name: __.typx.Annotated[
32 str,
33 __.typx.Doc( "For derivation of platform directories." ),
34 ] = _nomina.package_name
35 publisher: __.typx.Annotated[
36 __.typx.Optional[ str ],
37 __.typx.Doc( "For derivation of platform directories." ),
38 __.tyro.conf.Suppress,
39 ] = None
40 version: __.typx.Annotated[
41 __.typx.Optional[ str ],
42 __.typx.Doc( "For derivation of platform directories." ),
43 __.tyro.conf.Suppress,
44 ] = None
46 def produce_platform_directories( self ) -> __.PlatformDirs:
47 ''' Produces platform directories object for application. '''
48 arguments = dict( appname = self.name, ensure_exists = True )
49 if self.publisher: arguments[ 'appauthor' ] = self.publisher
50 if self.version: arguments[ 'version' ] = self.version
51 return __.PlatformDirs( **arguments ) # type: ignore