File tree Expand file tree Collapse file tree 5 files changed +24
-8
lines changed
Expand file tree Collapse file tree 5 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 44## Usage
55
66``` bash
7- labelme data_annotated --labels labels.txt --autosave
7+ labelme data_annotated --labels labels.txt
88```
99
1010![ ] ( .readme/annotation.jpg )
Original file line number Diff line number Diff line change @@ -137,10 +137,17 @@ def main():
137137 default = argparse .SUPPRESS ,
138138 )
139139 parser .add_argument (
140- "--autosave" ,
140+ "--no- autosave" ,
141141 dest = "auto_save" ,
142+ action = "store_false" ,
143+ help = "disable auto save" ,
144+ default = argparse .SUPPRESS ,
145+ )
146+ parser .add_argument (
147+ "--autosave" ,
148+ dest = "_deprecated_autosave" ,
142149 action = "store_true" ,
143- help = "auto save" ,
150+ help = argparse . SUPPRESS ,
144151 default = argparse .SUPPRESS ,
145152 )
146153 parser .add_argument (
@@ -199,6 +206,15 @@ def main():
199206 )
200207 del args ._deprecated_nodata
201208
209+ if hasattr (args , "_deprecated_autosave" ):
210+ warnings .warn (
211+ "--autosave is deprecated and will be removed in a future version. "
212+ "Auto save is now enabled by default. Use --no-autosave to disable it." ,
213+ FutureWarning ,
214+ stacklevel = 1 ,
215+ )
216+ del args ._deprecated_autosave
217+
202218 if args .version :
203219 print (f"{ __appname__ } { __version__ } " )
204220 sys .exit (0 )
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ def get_user_config_file(create_if_missing: bool = True) -> str:
7373 "#\n "
7474 "# Example:\n "
7575 "# with_image_data: true\n "
76- "# auto_save: true \n "
76+ "# auto_save: false \n "
7777 "# labels: [cat, dog]\n "
7878 )
7979 except Exception :
Original file line number Diff line number Diff line change 1- auto_save : false
1+ auto_save : true
22display_label_popup : true
33with_image_data : false
44keep_prev : false
Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ def test_MainWindow_config(
2424 monkeypatch : pytest .MonkeyPatch ,
2525) -> None :
2626 config_file : Path | None = None
27- auto_save : bool = False
27+ auto_save : bool = True
2828 if with_config_file :
2929 config_file = tmp_path / "labelmerc.yaml"
30- config_file .write_text ("auto_save: true \n labels: [cat, dog]\n " )
31- auto_save = True
30+ config_file .write_text ("auto_save: false \n labels: [cat, dog]\n " )
31+ auto_save = False
3232
3333 win : labelme .app .MainWindow = labelme .app .MainWindow (
3434 config_file = config_file ,
You can’t perform that action at this time.
0 commit comments