File tree 3 files changed +6
-11
lines changed
3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -1029,25 +1029,20 @@ def open_in_external_editor(self, filename):
1029
1029
return False
1030
1030
1031
1031
def edit_config (self ):
1032
- #TODO put default-config somewhere accessible to this code
1033
- DEFAULT = ("[general]\n "
1034
- "syntax = True\n "
1035
- "[keyboard]\n "
1036
- "pastebin = F8\n "
1037
- "save = C-s\n " )
1038
-
1039
- open ('a.txt' , 'w' ).write (repr (self .config .config_path ))
1040
1032
if not (os .path .isfile (self .config .config_path )):
1041
1033
if self .interact .confirm (_ ("Config file does not exist - create new from default? (y/N)" )):
1042
1034
try :
1035
+ bpython_dir , script_name = os .path .split (__file__ )
1036
+ with open (os .path .join (bpython_dir , "sample-config" )) as f :
1037
+ default_config = f .read ()
1038
+
1043
1039
containing_dir = os .path .dirname (os .path .abspath (self .config .config_path ))
1044
1040
if not os .path .exists (containing_dir ):
1045
1041
os .makedirs (containing_dir )
1046
1042
with open (self .config .config_path , 'w' ) as f :
1047
- f .write (DEFAULT )
1043
+ f .write (default_config )
1048
1044
except (IOError , OSError ) as e :
1049
1045
self .interact .notify ('error creating file: %r' % e )
1050
- raise e
1051
1046
return False
1052
1047
else :
1053
1048
return False
File renamed without changes.
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ def initialize_options(self):
184
184
packages = packages ,
185
185
data_files = data_files ,
186
186
package_data = {
187
- 'bpython' : ['logo.png' ],
187
+ 'bpython' : ['logo.png' , 'sample-config' ],
188
188
'bpython.translations' : mo_files ,
189
189
'bpython.test' : ['test.config' , 'test.theme' ]
190
190
},
You can’t perform that action at this time.
0 commit comments