-
Notifications
You must be signed in to change notification settings - Fork 0
add behavior custom bando state #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mamico
wants to merge
19
commits into
master
Choose a base branch
from
stato_custom
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
94a789f
ci: add plone 60
mamico 16b44f6
ci
mamico dff2cf0
tests
mamico 9dd1d15
black
mamico 74db381
black
mamico 45acc11
tests
mamico 73d0ddd
ci
mamico d367e9f
ci
mamico d4280af
pyroma
mamico 72ef895
zpretty
mamico 2c8d7bd
Potential fix for code scanning alert no. 15: Workflow does not conta…
mamico 981aba0
ci
mamico a6f78f7
Potential fix for code scanning alert no. 7: Workflow does not contai…
mamico a85a76a
Potential fix for code scanning alert no. 14: Workflow does not conta…
mamico 5fe3ef4
Potential fix for code scanning alert no. 8: Workflow does not contai…
mamico 1686ae6
Potential fix for code scanning alert no. 17: Workflow does not conta…
mamico 33a6001
changelog
mamico 098ec3b
disabled tests on plone52
mamico 56c1d1c
readme.badges
mamico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Security check - Bandit | ||
|
|
||
| on: push | ||
|
|
||
| jobs: | ||
| analyze: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # required for all workflows | ||
| security-events: write | ||
| # only required for workflows in private repositories | ||
| actions: read | ||
| contents: read | ||
| steps: | ||
| - name: Perform Bandit Analysis | ||
| uses: PyCQA/bandit-action@v1 | ||
| with: | ||
| targets: ./redturtle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Black | ||
| on: [push] | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [3.11] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: install black | ||
| run: pip install black | ||
|
|
||
| - name: run black | ||
| run: black redturtle/ --check --diff | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Flake8 | ||
| on: [push] | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [3.11] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: install flake8 | ||
| run: pip install flake8 | ||
|
|
||
| - name: run flake8 | ||
| run: flake8 redturtle/ setup.py | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| permissions: | ||
| contents: read | ||
| name: Run isort | ||
| on: | ||
| - push | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # - uses: isort/isort-action@v1 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: install isort | ||
| run: pip install isort | ||
|
|
||
| - name: run isort | ||
| run: isort --check-only redturtle | ||
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| permissions: | ||
| contents: read | ||
| name: Pyroma | ||
| on: [push] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [3.11] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: install pyroma | ||
| run: pip install pyroma==4.2 | ||
|
|
||
| - name: run pyroma | ||
| run: pyroma -n 10 -d . | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| permissions: | ||
| contents: read | ||
| name: zpretty | ||
| on: [push] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [3.11] | ||
|
|
||
| steps: | ||
| # git checkout | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # python setup | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| # python cache | ||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| # install zpretty | ||
| - name: install zpretty | ||
| run: pip install zpretty | ||
|
|
||
| # run zpretty | ||
| - name: run zpretty | ||
| run: find redturtle -name '*.zcml' | xargs zpretty -i | ||
|
|
||
| # XXX: this doesn't work on gh actions (https://github.com/plone/plone.restapi/pull/1119/checks?check_run_id=2686474411) | ||
| # run git diff | ||
| - name: run git diff | ||
| run: git diff --exit-code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,4 @@ local/ | |
| .sass-cache/ | ||
| __pycache__ | ||
| .python-version | ||
| pyvenv.cfg | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [settings] | ||
| profile=plone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ | |
|
|
||
| # use this extend one of the buildout configuration: | ||
| extends = | ||
| test_plone52.cfg | ||
| test_plone60.cfg | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages | ||
| try: | ||
| __import__('pkg_resources').declare_namespace(__name__) | ||
| __import__("pkg_resources").declare_namespace(__name__) | ||
| except ImportError: | ||
| from pkgutil import extend_path | ||
|
|
||
| __path__ = extend_path(__path__, __name__) |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| """Main product initializer | ||
| """ | ||
| """Main product initializer""" | ||
|
|
||
| from zope.i18nmessageid import MessageFactory | ||
|
|
||
| import logging | ||
|
|
||
| logger = logging.getLogger('redturtle.bandi') | ||
| bandiMessageFactory = MessageFactory('redturtle.bandi') | ||
|
|
||
| logger = logging.getLogger("redturtle.bandi") | ||
| bandiMessageFactory = MessageFactory("redturtle.bandi") | ||
| _ = bandiMessageFactory |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <configure | ||
| xmlns="http://namespaces.zope.org/zope" | ||
| xmlns:plone="http://namespaces.plone.org/plone" | ||
| i18n_domain="redturtle.bandi" | ||
| > | ||
|
|
||
|
|
||
| <plone:behavior | ||
| name="redturtle.bandi.forced_state" | ||
| title="Possibilità di impostare lo stato del bando" | ||
| factory=".force.ForcedState" | ||
| provides=".force.IForcedState" | ||
| marker=".force.IForcedState" | ||
| /> | ||
| </configure> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| from plone.autoform.interfaces import IFormFieldProvider | ||
| from plone.dexterity.interfaces import IDexterityContent | ||
| from plone.supermodel import model | ||
| from redturtle.bandi import _ | ||
| from redturtle.bandi.config import STATES | ||
| from redturtle.bandi.interfaces.bando import IBando | ||
| from zope import schema | ||
| from zope.component import adapter | ||
| from zope.interface import implementer | ||
| from zope.interface import provider | ||
| from zope.schema.vocabulary import SimpleTerm | ||
| from zope.schema.vocabulary import SimpleVocabulary | ||
|
|
||
|
|
||
| @provider(IFormFieldProvider) | ||
| class IForcedState(model.Schema): | ||
| """Marker inteerface for content type Bando""" | ||
|
|
||
| forced_state = schema.Choice( | ||
| title=_("stato_avanzamento_label", default="Stato di avanzamento"), | ||
| description=_( | ||
| "stato_avanzamento_help", | ||
| default=( | ||
| "Indica lo stato di avanzamento. Se il campo esiste, viene " | ||
| "utilizzato per determinare lo stato del bando. Se non esiste, " | ||
| "viene utilizzato il metodo di base per cui lo stato del bando " | ||
| "è determinato dalle date di apertura, scadenza e chiusura procedimento." | ||
| ), | ||
| ), | ||
| required=False, | ||
| vocabulary=SimpleVocabulary( | ||
| [SimpleTerm(state, state, STATES[state]["label"]) for state in STATES] | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| @implementer(IBando) | ||
| @adapter(IDexterityContent) | ||
| class ForcedState(object): | ||
| """Bando adapter""" | ||
|
|
||
| def __init__(self, context): | ||
| self.context = context |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.