diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-12-30 20:21:47 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-12-30 20:21:47 +0000 |
commit | c0545b8777914d5b116a76252b03c4a7fb5ce576 (patch) | |
tree | 4ba6b42d44f3e5ce3589619d9131075769a2f37e /core/models/caves.py | |
parent | 4470c5abbd165597dbdba29ae9f830d4170ae428 (diff) | |
download | troggle-c0545b8777914d5b116a76252b03c4a7fb5ce576.tar.gz troggle-c0545b8777914d5b116a76252b03c4a7fb5ce576.tar.bz2 troggle-c0545b8777914d5b116a76252b03c4a7fb5ce576.zip |
separate chmod from context
Diffstat (limited to 'core/models/caves.py')
-rw-r--r-- | core/models/caves.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/models/caves.py b/core/models/caves.py index 9b3e5b0..91ec492 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -50,12 +50,12 @@ def writetrogglefile(filepath, filecontent): # do not trap exceptions, pass them up to the view that called this function # if the os.chmod fails, it can zero the contents of the file as a side effect. Dangerous. with open(filepath, "w") as f: - f.write(filecontent) - filepath.chmod(0o664) # set file permissions to rw-rw-r-- - # os.chmod(filepath, 0o664) # set file permissions to rw-rw-r-- print(f'WRITING{cwd}---{filename} ') - call([git, "add", filename], cwd=cwd) - call([git, "commit", "-m", 'Online cave or entrance edit'], cwd=cwd) + f.write(filecontent) + #filepath.chmod(0o664) # set file permissions to rw-rw-r-- + os.chmod(filepath, 0o664) # set file permissions to rw-rw-r-- + call([git, "add", filename], cwd=cwd) + call([git, "commit", "-m", 'Online cave or entrance edit'], cwd=cwd) class Area(TroggleModel): |