Skip to content

Commit ff794a6

Browse files
committed
Add cookie cutter content
Signed-off-by: thepetk <thepetk@gmail.com>
1 parent 471396e commit ff794a6

File tree

487 files changed

+344149
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

487 files changed

+344149
-0
lines changed

Makefile

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Makefile for gr Python Documentation
2+
#
3+
# Here is what you can do:
4+
#
5+
# - make # Automatically build an HTML local version
6+
# - make todo # To list remaining tasks
7+
# - make verifs # To check for correctness: wrapping, spelling
8+
# - make wrap # To check for wrapping
9+
# - make spell # To check for spelling
10+
# - make merge # To merge pot from upstream
11+
# - make fuzzy # To find fuzzy strings
12+
# - make progress # To compute current progression
13+
#
14+
# Modes are: autobuild-stable, autobuild-dev, and autobuild-html,
15+
# documented in gen/src/3.6/Doc/Makefile as we're only delegating the
16+
# real work to the Python Doc Makefile.
17+
18+
# Configuration
19+
20+
# The CPYTHON_CURRENT_COMMIT is the commit, in the cpython repository,
21+
# from which we generated our po files. We use it here so when we
22+
# test build, we're building with the .rst files that generated our
23+
# .po files.
24+
CPYTHON_CURRENT_COMMIT := 9cbde7c6ce6f7b93301a37f03dfa0c0d45e00a39
25+
26+
CPYTHON_PATH := /home/tpetkos/github.com/python/cpython/
27+
28+
LANGUAGE := gr
29+
BRANCH := 3.12
30+
31+
EXCLUDED := whatsnew/ c-api/
32+
33+
# Internal variables
34+
35+
UPSTREAM := https://github.com/python/cpython
36+
37+
PYTHON := $(shell which python3)
38+
MODE := html
39+
POSPELL_TMP_DIR := .pospell/
40+
JOBS := auto
41+
42+
# Detect OS
43+
44+
ifeq '$(findstring ;,$(PATH))' ';'
45+
detected_OS := Windows
46+
else
47+
detected_OS := $(shell uname 2>/dev/null || echo Unknown)
48+
detected_OS := $(patsubst CYGWIN%,Cygwin,$(detected_OS))
49+
detected_OS := $(patsubst MSYS%,MSYS,$(detected_OS))
50+
detected_OS := $(patsubst MINGW%,MSYS,$(detected_OS))
51+
endif
52+
53+
ifeq ($(detected_OS),Darwin) # Mac OS X
54+
CP_CMD := gcp # accessible with `brew install coreutils` or `brew upgrade coreutils`
55+
else
56+
CP_CMD := cp
57+
endif
58+
59+
.PHONY: all
60+
all: ensure_prerequisites
61+
git -C $(CPYTHON_PATH) checkout $(CPYTHON_CURRENT_COMMIT)
62+
mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/
63+
$(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/
64+
$(MAKE) -C $(CPYTHON_PATH)/Doc/ \
65+
SPHINXOPTS='-qW -j$(JOBS) \
66+
-D locale_dirs=$(abspath locales) \
67+
-D language=$(LANGUAGE) \
68+
-D gettext_compact=0 \
69+
-D latex_engine=xelatex \
70+
-D latex_elements.inputenc= \
71+
-D latex_elements.fontenc=' \
72+
$(MODE)
73+
git -C $(CPYTHON_PATH) checkout -
74+
@echo "Build success, open file://$(abspath $(CPYTHON_PATH))/Doc/build/html/index.html or run 'make serve' to see them."
75+
76+
77+
.PHONY: ensure_prerequisites
78+
ensure_prerequisites:
79+
@if [ -z $(CPYTHON_PATH) ]; then \
80+
echo "Your CPYTHON_PATH is empty, please provide one."; \
81+
exit 1; \
82+
fi
83+
@if ! [ -d $(CPYTHON_PATH) ]; then \
84+
echo "Building the translation requires a cpython clone."; \
85+
echo "Please provide the path to a clone using the CPYTHON_PATH variable."; \
86+
echo "(Currently CPYTHON_PATH is $(CPYTHON_PATH)."; \
87+
echo "So you may want to run:"; \
88+
echo ""; \
89+
echo " git clone $(UPSTREAM) $(CPYTHON_PATH)"; \
90+
exit 1; \
91+
fi
92+
@if [ -n "$$(git -C $(CPYTHON_PATH) status --porcelain)" ]; then \
93+
echo "Your cpython clone at $(CPYTHON_PATH) is not clean."; \
94+
echo "In order to avoid breaking things, please clean it first."; \
95+
exit 1; \
96+
fi
97+
@if ! (blurb help >/dev/null 2>&1 && sphinx-build --version >/dev/null 2>&1); then \
98+
git -C $(CPYTHON_PATH) checkout $(BRANCH); \
99+
echo "You're missing dependencies, please enable a venv and install:"; \
100+
echo ""; \
101+
echo " python -m pip install -r requirements.txt -r $(CPYTHON_PATH)/Doc/requirements.txt"; \
102+
exit 1; \
103+
fi
104+
105+
.PHONY: serve
106+
serve:
107+
$(MAKE) -C $(CPYTHON_PATH)/Doc/ serve
108+
109+
110+
.PHONY: progress
111+
progress:
112+
@$(PYTHON) -c 'import sys; print("{:.1%}".format(int(sys.argv[1]) / int(sys.argv[2])))' \
113+
$(shell msgcat *.po */*.po | msgattrib --translated | grep -c '^msgid') \
114+
$(shell msgcat *.po */*.po | grep -c '^msgid')
115+
116+
117+
.PHONY: todo
118+
todo: ensure_prerequisites
119+
potodo --exclude venv .venv $(EXCLUDED)
120+
121+
.PHONY: wrap
122+
wrap: ensure_prerequisites
123+
@echo "Verify wrapping"
124+
powrap --check --quiet *.po **/*.po
125+
126+
SRCS = $(shell git diff --name-only $(BRANCH) | grep '.po$$')
127+
# foo/bar.po => $(POSPELL_TMP_DIR)/foo/bar.po.out
128+
DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))
129+
130+
.PHONY: spell
131+
spell: ensure_prerequisites $(DESTS)
132+
133+
$(POSPELL_TMP_DIR)/%.po.out: %.po dict
134+
@echo "Pospell checking $<..."
135+
mkdir -p $(@D)
136+
pospell -p dict -l fr_FR $< && touch $@
137+
138+
.PHONY: fuzzy
139+
fuzzy: ensure_prerequisites
140+
potodo -f --exclude venv .venv $(EXCLUDED)
141+
142+
.PHONY: verifs
143+
verifs: wrap spell
144+
145+
.PHONY: merge
146+
merge: ensure_prerequisites
147+
@echo "Merge from $(UPSTREAM)"
148+
git -C $(CPYTHON_PATH) checkout $(BRANCH)
149+
git -C $(CPYTHON_PATH) pull --ff-only
150+
(cd $(CPYTHON_PATH)/Doc; sphinx-build -Q -b gettext -D gettext_compact=0 . ../pot)
151+
find $(CPYTHON_PATH)/pot/ -name '*.pot' |\
152+
while read -r POT; \
153+
do \
154+
PO="./$$(echo "$$POT" | sed "s#$(CPYTHON_PATH)/pot/##; s#\.pot\$$#.po#")"; \
155+
mkdir -p "$$(dirname "$$PO")"; \
156+
if [ -f "$$PO" ]; \
157+
then \
158+
msgmerge --backup=off --force-po -U "$$PO" "$$POT"; \
159+
else \
160+
msgcat -o "$$PO" "$$POT"; \
161+
fi \
162+
done
163+
rm -fr $(CPYTHON_PATH)/pot/
164+
sed -i 's|^#: .*Doc/|#: |' *.po */*.po
165+
powrap -m
166+
@printf "\n%s %s\n" "Replace CPYTHON_CURRENT_COMMIT in Makefile by: " $(shell git -C $(CPYTHON_PATH) rev-parse HEAD)
167+
@printf 'To add, you can use:\n git status -s | grep "^ M .*\.po" | cut -d" " -f3 | while read -r file; do if [ $$(git diff "$$file" | wc -l) -gt 13 ]; then git add "$$file"; fi ; done\n'
168+
169+
.PHONY: clean
170+
clean:
171+
@echo "Cleaning *.mo and $(POSPELL_TMP_DIR)"
172+
rm -fr $(POSPELL_TMP_DIR)
173+
find -name '*.mo' -delete

about.po

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) 2001-2024, Python Software Foundation
3+
# This file is distributed under the same license as the Python package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Python 3.12\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2024-03-14 12:51+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=UTF-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
19+
#: about.rst:3
20+
msgid "About these documents"
21+
msgstr ""
22+
23+
#: about.rst:6
24+
msgid ""
25+
"These documents are generated from `reStructuredText`_ sources by `Sphinx`_, "
26+
"a document processor specifically written for the Python documentation."
27+
msgstr ""
28+
29+
#: about.rst:15
30+
msgid ""
31+
"Development of the documentation and its toolchain is an entirely volunteer "
32+
"effort, just like Python itself. If you want to contribute, please take a "
33+
"look at the :ref:`reporting-bugs` page for information on how to do so. New "
34+
"volunteers are always welcome!"
35+
msgstr ""
36+
37+
#: about.rst:20
38+
msgid "Many thanks go to:"
39+
msgstr ""
40+
41+
#: about.rst:22
42+
msgid ""
43+
"Fred L. Drake, Jr., the creator of the original Python documentation toolset "
44+
"and writer of much of the content;"
45+
msgstr ""
46+
47+
#: about.rst:24
48+
msgid ""
49+
"the `Docutils <https://docutils.sourceforge.io/>`_ project for creating "
50+
"reStructuredText and the Docutils suite;"
51+
msgstr ""
52+
53+
#: about.rst:26
54+
msgid ""
55+
"Fredrik Lundh for his Alternative Python Reference project from which Sphinx "
56+
"got many good ideas."
57+
msgstr ""
58+
59+
#: about.rst:31
60+
msgid "Contributors to the Python Documentation"
61+
msgstr ""
62+
63+
#: about.rst:33
64+
msgid ""
65+
"Many people have contributed to the Python language, the Python standard "
66+
"library, and the Python documentation. See :source:`Misc/ACKS` in the "
67+
"Python source distribution for a partial list of contributors."
68+
msgstr ""
69+
70+
#: about.rst:37
71+
msgid ""
72+
"It is only with the input and contributions of the Python community that "
73+
"Python has such wonderful documentation -- Thank You!"
74+
msgstr ""

0 commit comments

Comments
 (0)