File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed
Expand file tree Collapse file tree 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):
10291029 return False
10301030
10311031 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 ))
10401032 if not (os .path .isfile (self .config .config_path )):
10411033 if self .interact .confirm (_ ("Config file does not exist - create new from default? (y/N)" )):
10421034 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+
10431039 containing_dir = os .path .dirname (os .path .abspath (self .config .config_path ))
10441040 if not os .path .exists (containing_dir ):
10451041 os .makedirs (containing_dir )
10461042 with open (self .config .config_path , 'w' ) as f :
1047- f .write (DEFAULT )
1043+ f .write (default_config )
10481044 except (IOError , OSError ) as e :
10491045 self .interact .notify ('error creating file: %r' % e )
1050- raise e
10511046 return False
10521047 else :
10531048 return False
File renamed without changes.
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ def initialize_options(self):
184184 packages = packages ,
185185 data_files = data_files ,
186186 package_data = {
187- 'bpython' : ['logo.png' ],
187+ 'bpython' : ['logo.png' , 'sample-config' ],
188188 'bpython.translations' : mo_files ,
189189 'bpython.test' : ['test.config' , 'test.theme' ]
190190 },
You can’t perform that action at this time.
0 commit comments