Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
313e50d3
Commit
313e50d3
authored
2 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
chore: Setup.py: Add type annotations
parent
38b0f471
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+15
-7
15 additions, 7 deletions
setup.py
with
15 additions
and
7 deletions
setup.py
+
15
−
7
View file @
313e50d3
...
...
@@ -2,6 +2,8 @@
from
__future__
import
annotations
from
typing
import
cast
import
os
import
sys
...
...
@@ -16,6 +18,9 @@
from
setuptools.command.install
import
install
as
_install
DataFilesT
=
list
[
tuple
[
str
,
list
[
str
]]]
MAN_FILES
=
[
'
gajim.1
'
,
'
gajim-remote.1
'
...
...
@@ -65,7 +70,7 @@ def build_translation() -> None:
print
(
'
Compiling %s >> %s
'
%
(
po_file
,
mo_file
))
def
install_trans
(
data_files
)
->
None
:
def
install_trans
(
data_files
:
DataFilesT
)
->
None
:
for
lang
in
ALL_LINGUAS
:
mo_file
=
str
(
BUILD_DIR
/
'
mo
'
/
lang
/
'
LC_MESSAGES
'
/
'
gajim.mo
'
)
target
=
f
'
share/locale/
{
lang
}
/LC_MESSAGES
'
...
...
@@ -97,7 +102,7 @@ def build_man() -> None:
print
(
'
Compiling %s >> %s
'
%
(
filename
,
man_file_gz
))
def
install_man
(
data_files
)
->
None
:
def
install_man
(
data_files
:
DataFilesT
)
->
None
:
man_dir
=
BUILD_DIR
/
'
man
'
target
=
'
share/man/man1
'
...
...
@@ -120,12 +125,15 @@ def build_intl() -> None:
merge
(
Path
(
filename
+
'
.in
'
),
newfile
,
option
)
def
install_intl
(
data_files
)
->
None
:
def
install_intl
(
data_files
:
DataFilesT
)
->
None
:
for
filename
,
target
,
_
in
META_FILES
:
data_files
.
append
((
target
,
[
str
(
BUILD_DIR
/
filename
)]))
def
merge
(
in_file
,
out_file
,
option
,
po_dir
:
str
=
'
po
'
)
->
None
:
def
merge
(
in_file
:
Path
,
out_file
:
Path
,
option
:
str
,
po_dir
:
str
=
'
po
'
)
->
None
:
'''
Run the msgfmt command.
'''
...
...
@@ -154,12 +162,12 @@ def run(self):
class
install
(
_install
):
def
run
(
self
):
data_files
=
self
.
distribution
.
data_files
data_files
=
cast
(
DataFilesT
,
self
.
distribution
.
data_files
)
# pyright: ignore
install_trans
(
data_files
)
if
sys
.
platform
!=
'
win32
'
:
install_man
(
data_files
)
install_intl
(
data_files
)
_install
.
run
(
self
)
_install
.
run
(
self
)
# pyright: ignore
# only install subdirectories of data
...
...
@@ -170,7 +178,7 @@ def run(self):
[
"
gajim/data/icons/hicolor/scalable/apps/org.gajim.Gajim-symbolic.svg
"
])
]
data_files
=
data_files_app_icon
data_files
:
DataFilesT
=
data_files_app_icon
setup
(
cmdclass
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment