wxPython/wxGlade-0.9.1/codegen/__init__.py
def new_project(self, app, out_path=None, preview=False):
        "Initialise generic and language independent code generator settings; see init_lang(), init_files()"

        # set (most of) instance variables back to default values
        self._init_vars()

        # application name
        self.app_name = app.name
        if self.app_name:
            self.app_filename = '%s.%s' % ( self.app_name, self.default_extensions[0] )
            self._textdomain = self.app_name

        # file encoding
        self.app_encoding = app.encoding.upper() or config.default_encoding
        # wx doesn't like latin-1
        if self.app_encoding == 'latin-1':
            self.app_encoding = 'ISO-8859-1'

        # Indentation symbol and level based on the project options
        self.indent_symbol = app.properties["indent_mode"].get_string_value()
        if self.indent_symbol == 'tab':
            self.indent_symbol = '\t'
        elif self.indent_symbol == 'space':
            self.indent_symbol = ' '
        else:
            self.indent_symbol = config.default_indent_symbol
        self.indent_amount = app.indent_amount

        if preview:
            self.multiple_files = False
            self._overwrite = True
            self._mark_blocks = False
            self._use_gettext = False
        else:
            self.multiple_files = app.multiple_files
            self._overwrite = app.overwrite
            self._mark_blocks = True if self._overwrite else app.mark_blocks
            self._use_gettext = app.use_gettext

        if not preview:
            self.for_version = tuple([int(t) for t in app.for_version.split('.')[:2]])
        else:
            self.for_version = compat.version
        self.is_template = app.is_template

        if self.multiple_files:
            self.out_dir = out_path or config.default_output_path
        else:
            self.out_dir = out_path or config.default_output_file
        self.out_dir = os.path.normpath( os.path.expanduser(self.out_dir.strip()) )
        self.preview = preview

        self.init_lang(app)      # call initialisation of language specific settings
        self.check_values()            # check the validity of the set values
        self.init_files(self.out_dir)
Initialise generic and language independent code generator settings; see init_lang(), init_files()
Initialise generic and language independent code generator settings; see init_lang(), init_files()
Initialise generic and language independent code generator settings ; see init_lang () init_files ()
def new_project(self, app, out_path=None, preview=False):
        self._init_vars()
        self.app_name = app.name
        if self.app_name:
            self.app_filename = '%s.%s' % ( self.app_name, self.default_extensions[0] )
            self._textdomain = self.app_name
        self.app_encoding = app.encoding.upper() or config.default_encoding
        if self.app_encoding == 'latin-1':
            self.app_encoding = 'ISO-8859-1'
        self.indent_symbol = app.properties["indent_mode"].get_string_value()
        if self.indent_symbol == 'tab':
            self.indent_symbol = '\t'
        elif self.indent_symbol == 'space':
            self.indent_symbol = ' '
        else:
            self.indent_symbol = config.default_indent_symbol
        self.indent_amount = app.indent_amount
        if preview:
            self.multiple_files = False
            self._overwrite = True
            self._mark_blocks = False
            self._use_gettext = False
        else:
            self.multiple_files = app.multiple_files
            self._overwrite = app.overwrite
            self._mark_blocks = True if self._overwrite else app.mark_blocks
            self._use_gettext = app.use_gettext
        if not preview:
            self.for_version = tuple([int(t) for t in app.for_version.split('.')[:2]])
        else:
            self.for_version = compat.version
        self.is_template = app.is_template
        if self.multiple_files:
            self.out_dir = out_path or config.default_output_path
        else:
            self.out_dir = out_path or config.default_output_file
        self.out_dir = os.path.normpath( os.path.expanduser(self.out_dir.strip()) )
        self.preview = preview
        self.init_lang(app)      
        self.check_values()            
        self.init_files(self.out_dir)
def new_project ( self , app , out_path = None , preview = False ) : self . _init_vars ( ) self . app_name = app . name if self . app_name : self . app_filename = '%s.%s' % ( self . app_name , self . default_extensions [ 0 ] ) self . _textdomain = self . app_name self . app_encoding = app . encoding . upper ( ) or config . default_encoding if self . app_encoding == 'latin-1' : self . app_encoding = 'ISO-8859-1' self . indent_symbol = app . properties [ "indent_mode" ] . get_string_value ( ) if self . indent_symbol == 'tab' : self . indent_symbol = '\t' elif self . indent_symbol == 'space' : self . indent_symbol = ' ' else : self . indent_symbol = config . default_indent_symbol self . indent_amount = app . indent_amount if preview : self . multiple_files = False self . _overwrite = True self . _mark_blocks = False self . _use_gettext = False else : self . multiple_files = app . multiple_files self . _overwrite = app . overwrite self . _mark_blocks = True if self . _overwrite else app . mark_blocks self . _use_gettext = app . use_gettext if not preview : self . for_version = tuple ( [ int ( t ) for t in app . for_version . split ( '.' ) [ : 2 ] ] ) else : self . for_version = compat . version self . is_template = app . is_template if self . multiple_files : self . out_dir = out_path or config . default_output_path else : self . out_dir = out_path or config . default_output_file self . out_dir = os . path . normpath ( os . path . expanduser ( self . out_dir . strip ( ) ) ) self . preview = preview self . init_lang ( app ) self . check_values ( ) self . init_files ( self . out_dir )
Initialise generic and language independent code generator settings; see init_lang(), init_files()
Initialise generic and language independent code generator settings ; see init_lang () init_files ()
"Initialise generic and language independent code generator settings; see init_lang(), init_files()" # set (most of) instance variables back to default values # application name # file encoding # wx doesn't like latin-1 # Indentation symbol and level based on the project options # call initialisation of language specific settings # check the validity of the set values
self
app
out_path
preview