Skip to content

Commit

Permalink
Merge branch 'main' into fb_versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho authored Dec 11, 2024
2 parents bf4095f + 6a041ba commit bcdcf3c
Show file tree
Hide file tree
Showing 78 changed files with 1,630 additions and 1,094 deletions.
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.devcontainer
.github
.ropeproject
.vscode
build
dist
docker/alpine/var
docker/elastic
docker/solr
docker/ubuntu/var
docker/zeo/var
docker/zope/var
87 changes: 44 additions & 43 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,49 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
push:
pull_request:
schedule:
- cron: "0 12 * * 0" # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
strategy:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ubuntu
config:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
runs-on: ${{ matrix.os }}-latest
name: ${{ matrix.os }}-${{ matrix.config }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config }}-${{ hashFiles('setup.*', 'requirements*') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip pytest
pip install -e .
- name: Test
run: |
tree -L 1
pytest ./tests/
build:
strategy:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ubuntu
config:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
runs-on: ${{ matrix.os }}-latest
name: ${{ matrix.os }}-${{ matrix.config }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config }}-${{ hashFiles('setup.*', 'requirements*') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip pytest
pip install -e .
- name: Test
run: |
tree -L 1
pytest ./tests/
82 changes: 75 additions & 7 deletions .vscode/Native.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,47 @@
{
"name": "ZMS5",
"path": "../"
}
},
// {
// "name": "ZMS4",
// "path": "../../ZMS4"
// },
// {
// "name": "ZMS3",
// "path": "../../ZMS3"
// },
// {
// "name": "Zope 5",
// "path": "/home/zope/src/zopefoundation/Zope"
// },
// {
// "name": "ZMS5 Dev Instance",
// "path": "/home/zope/instance/zms5_dev"
// },
// {
// "name": "OpenSearchServer",
// "path": "/home/zope/src/sntl-projects/opensearch_demo"
// },
// {
// "name": "Zope-WebDAV Access",
// "uri": "webdav://admin:admin@localhost:8091/"
// },
// {
// "path": "../../../../vpy38/lib/python3.8/site-packages/pydoctor"
// }
],

"settings": {
"python.defaultInterpreterPath": "~/vpy38/bin/python",
"python.defaultInterpreterPath": "~/vpy313/bin/python",
"window.zoomLevel": 0,
"git.ignoreMissingGitWarning": true,
"editor.minimap.enabled": false,
"editor.renderWhitespace": "all",
"editor.renderControlCharacters": false,
"workbench.iconTheme": "vs-minimal",
"workbench.colorTheme": "Visual Studio Light",
"files.eol": "\n",
"files.autoSave": "afterDelay",
"files.associations": {
"*.zpt": "html",
"*.zcml": "xml"
Expand All @@ -33,10 +64,47 @@
"**/Data.*": true,
"**/docker/**/var/*": true
},
"files.eol": "\n",
"files.autoSave": "afterDelay",
"workbench.colorTheme": "Visual Studio Light",
"python.linting.enabled": true
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test*.py"
],
},
"remoteAuthority": "wsl+Ubuntu"

"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "ZMS5-DEV",
"type": "debugpy",
"request": "launch",
"program": "~/vpy313/bin/runwsgi",
"justMyCode": false,
"console": "integratedTerminal",
"args": [
"--debug",
"--verbose",
"~/instance/zms5_dev/etc/zope.ini",
"debug-mode=on"
],
"env": {
"PYTHONUNBUFFERED": "1",
"CONFIG_FILE": "~/instance/zms5_dev/etc/zope.ini",
"INSTANCE_HOME": "~/instance/zms5_dev",
"CLIENT_HOME": "~/instance/zms5_dev",
"PYTHON": "~/vpy313/bin/python",
"SOFTWARE_HOME": "~/vpy313/bin/"
},
"serverReadyAction": {
"pattern": "Serving on http://127.0.0.1:8081",
"uriFormat": "http://127.0.0.1:8081/manage_main",
"action": "openExternally"
}
}
]
}
}
70 changes: 0 additions & 70 deletions .vscode/ZMS5.code-workspace

This file was deleted.

37 changes: 0 additions & 37 deletions .vscode/launch.json

This file was deleted.

12 changes: 0 additions & 12 deletions .vscode/settings.json

This file was deleted.

16 changes: 9 additions & 7 deletions Products/zms/ZMSMetaobjManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,14 +1176,16 @@ def manage_changeProperties(self, lang, btn='', key='all', REQUEST=None, RESPONS
# Upload resource.
if newType in self.valid_uploadtypes or isinstance(newCustom, ZPublisher.HTTPRequest.FileUpload):
if len(getattr(newCustom, 'filename', '')):
newCustom = _blobfields.createBlobField( self, _blobfields.MyFile, newCustom)
newCustom = _blobfields.createBlobField( self, _blobfields.MyFile, newCustom)
else:
savedAttr = [x for x in savedAttrs if x['id'] == old_id][0]
syncZopeMetaobjAttr( self, newValue, savedAttr)
if savedAttr.get('ob'):
filename = savedAttr['ob'].title
data = bytes(zopeutil.readData(savedAttr['ob']))
newCustom = _blobfields.createBlobField( self, _blobfields.MyFile, {'filename':filename,'data':data})
old_savedAttrs = [x for x in savedAttrs if x['id'] == old_id]
if old_savedAttrs:
savedAttr = old_savedAttrs[0]
syncZopeMetaobjAttr( self, newValue, savedAttr)
if savedAttr.get('ob'):
filename = savedAttr['ob'].title
data = bytes(zopeutil.readData(savedAttr['ob']))
newCustom = _blobfields.createBlobField( self, _blobfields.MyFile, {'filename':filename,'data':data})
# Change attribute.
message += self.setMetaobjAttr( id, old_id, attr_id, newName, newMandatory, newMultilang, newRepetitive, newType, newKeys, newCustom, newDefault)
# Return with message.
Expand Down
Loading

0 comments on commit bcdcf3c

Please sign in to comment.