2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 06:17:07 +00:00

Detect unwriteable file permissions earlier

This commit is contained in:
Philip Sargent
2022-03-05 17:05:15 +00:00
parent 32377f4e6c
commit d7fd6b00ae
6 changed files with 29 additions and 19 deletions

View File

@@ -42,7 +42,8 @@ def writetrogglefile(filepath, filecontent):
'''Set permissions to rw-rw-r-- and commit the new saved file to git
Callers to cave.writeDataFile() or entrance.writeDataFile() should handle the exception PermissionsError explicitly
'''
# see also core/views/expo.py editexpopage()
# GIT see also core/views/expo.py editexpopage()
# GIT see also core/views/uploads.py dwgupload()
filepath = Path(filepath)
cwd = filepath.parent
filename = filepath.name
@@ -56,7 +57,7 @@ def writetrogglefile(filepath, filecontent):
#os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
# should replace .call with .run and capture_output=True
call([git, "add", filename], cwd=cwd)
call([git, "commit", "-m", 'Troggle online cave or entrance edit'], cwd=cwd)
call([git, "commit", "-m", f'Troggle online: cave or entrance edit -{filename}'], cwd=cwd)
class Area(TroggleModel):