소스 검색

overwrite file on save instead of saving copy

Daniel Sheffield 2 년 전
부모
커밋
4d6b066413
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      app/activities/RecipeEditor.py
  2. 1 1
      recipe.py

+ 1 - 1
app/activities/RecipeEditor.py

@@ -288,7 +288,7 @@ class RecipeEditor(FocusWidget):
         fname = self.fname.get_edit_text()
         if not fname:
             return
-        with open(f'{fname}-modified.yaml', 'w') as f:
+        with open(fname, 'w') as f:
             yaml.dump(yml, f)
 
 

+ 1 - 1
recipe.py

@@ -72,7 +72,7 @@ with open(fname) as f:
 activity_manager.create(RecipeEditor,
     'recipe_editor',
     activity_manager, query_manager,
-    fname.rsplit('.', 1)[0], recipe,
+    fname, recipe,
 )
 
 app = Recipe(activity_manager)