From 4f9d5c93dc27f6377cdcafa210e1a821c50ed978 Mon Sep 17 00:00:00 2001 From: Ogenrwoth Jim frank <121643701+frankogenrwoth@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:11:47 +0300 Subject: [PATCH 1/3] add element as a public property not _element which is private --- src/docx/text/paragraph.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/docx/text/paragraph.py b/src/docx/text/paragraph.py index 234ea66cb..87aa5bdfd 100644 --- a/src/docx/text/paragraph.py +++ b/src/docx/text/paragraph.py @@ -171,3 +171,7 @@ def _insert_paragraph_before(self): """Return a newly created paragraph, inserted directly before this paragraph.""" p = self._p.add_p_before() return Paragraph(p, self._parent) + + @property + def element(self): + return self._element From 51ad177b640e660febedb93c21b81706bdc9eeeb Mon Sep 17 00:00:00 2001 From: Ogenrwoth Jim frank <121643701+frankogenrwoth@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:21:53 +0300 Subject: [PATCH 2/3] Create action to automatically sync my fork with the remote --- .github/workflows/main.yml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..cf9a54d28 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,42 @@ +name: Sync Fork + +on: + schedule: + - cron: '0 */6 * * *' # Runs every 6 hours + workflow_dispatch: # Allows manual trigger + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Add upstream repository + run: | + git remote add upstream https://github.com/python/python-docx.git + + - name: Fetch upstream changes + run: | + git fetch upstream + + - name: Sync master branch + run: | + git checkout master + git merge upstream/master + git push origin master + + - name: Sync main branch (if exists) + continue-on-error: true + run: | + git checkout main + git merge upstream/main + git push origin main From 9fe884e921fe13243fedcbd3232d79baba1aab5e Mon Sep 17 00:00:00 2001 From: Ogenrwoth Jim frank <121643701+frankogenrwoth@users.noreply.github.com> Date: Sat, 16 Nov 2024 16:25:39 +0300 Subject: [PATCH 3/3] Update main.yml --- .github/workflows/main.yml | 41 -------------------------------------- 1 file changed, 41 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf9a54d28..8b1378917 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,42 +1 @@ -name: Sync Fork -on: - schedule: - - cron: '0 */6 * * *' # Runs every 6 hours - workflow_dispatch: # Allows manual trigger - -jobs: - sync: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Add upstream repository - run: | - git remote add upstream https://github.com/python/python-docx.git - - - name: Fetch upstream changes - run: | - git fetch upstream - - - name: Sync master branch - run: | - git checkout master - git merge upstream/master - git push origin master - - - name: Sync main branch (if exists) - continue-on-error: true - run: | - git checkout main - git merge upstream/main - git push origin main