def user_interactions(self):
        print 'Hello and welcome to beaverAutoCAD textual interface!'
        print 'Files will be saved at: {}'.format(self.dir_name)
        print '(1) Sum Lines Lengths in a DWG to MS-Excel'
        print '(2) Sum Areas in a DWG to MS-Excel'
        print '(3) Count Blocks in a DWG to MS-Excel'
        print '(4) Count Blocks per layer in a DWG'
        user_chose = raw_input('Please choose what to do [1,2,3,4]: ')
        if user_chose == '1':
            user_string = raw_input('Enter a string to search in layer names: ')
            user_units = raw_input('Drawing units (m / [cm] / mm):')
            if not user_units:
                user_units = 'cm'
            beaverAutoCAD_core.line_lengths_excel(filename='AAC_lines_{}'.format(self.filename),
                                                  savingPath=self.dir_name,
                                                  draw_units=user_units,
                                                  layers_contain=user_string)
            print 'Done.'
        elif user_chose == '2':
                    user_string = raw_input('Enter a string to search in layer names: ')
                    user_units = raw_input('Drawing units (m / [cm] / mm):')
                    if not user_units:
                        user_units = 'cm'
                    beaverAutoCAD_core.sum_areas_excel(filename='AAC_areas_{}'.format(self.filename),
                                                          savingPath=self.dir_name,
                                                          draw_units=user_units,
                                                          layers_contain=user_string)
                    print 'Done.'

        elif user_chose == '3':
            user_string_layers = raw_input('Enter a string to search in layer names: ')
            user_string_blocks = raw_input('Enter a string to search in block names: ')
            user_layer0 = raw_input('Use layer 0? y/[n]')
            if not user_layer0 or user_layer0.lower() == 'n':
                user_layer0 = 'no'
            else:
                user_layer0 = 'yes'
            beaverAutoCAD_core.count_blocks_excel(filename="AAC_blocks_{}".format(self.filename),
                                                  savingPath=self.dir_name,
                                                  uselayer0=user_layer0,
                                                  layers_contain=user_string_layers,
                                                  blocks_contain=user_string_blocks)
            print 'Done.'
        elif user_chose == '4':
            user_string_layers = raw_input('Enter a string to search in layer names: ')
            user_string_blocks = raw_input('Enter a string to search in block names: ')
            user_layer0 = raw_input('Use layer 0? y/[n]')
            if not user_layer0 or user_layer0.lower() == 'n':
                user_layer0 = 'no'
            else:
                user_layer0 = 'yes'
            beaverAutoCAD_core.count_blocks_per_layer(filename="AAC_blocks_per_layer_{}".format(self.filename),
                                                      savingPath=self.dir_name,
                                                      uselayer0=user_layer0,
                                                      layers_contain=user_string_layers,
                                                      blocks_contain=user_string_blocks)
            print 'Done.'
        else:
            print 'No option was chosen. Goodbye!'
        print """
 def areas_sum(self, ):
     # This method connects the gui to the relevant function in the app's core
     savingPath = self.get_current_folder()
     filename = "AAC_areas_" + self.directory_settings()
     self.set_file_name(filename)
     draw_units = self.units.get_active_text()
     beaverAutoCAD_core.sum_areas_excel(filename, savingPath, draw_units)  # calls the function from the core
     print "Done."
 def areas_sum(self, ):
     # This method connects the gui to the relevant function in the app's core
     savingPath = self.get_current_folder()
     filename = "AAC_areas_" + self.directory_settings()
     self.set_file_name(filename)
     draw_units = self.units.get_active_text()
     beaverAutoCAD_core.sum_areas_excel(
         filename, savingPath,
         draw_units)  # calls the function from the core
     print "Done."
 def callback_areas_sum(self, widget, callback_data=None):
     '''
     This method connects the gui to the relevant function in the app's core
     '''
     self.layers_contain = self.layers_contain_box.get_text()
     if self.layers_contain != '':
         print 'Sum areas in layers contain: {}'.format(self.layers_contain)
     # self.set_file_name(filename)
     # calls the function from the core:
     # beaverAutoCAD_core.line_lengths_excel(filename, savingPath, draw_units)
     beaverAutoCAD_core.sum_areas_excel(filename="AAC_areas_{}".format(self.entry.get_text()),
                                        savingPath=self.directory_settings(),
                                        draw_units=self.units.get_active_text(),
                                        layers_contain=self.layers_contain)
     print "Done."
    def user_interactions(self):
        print 'Hello and welcome to beaverAutoCAD textual interface!'
        print 'Files will be saved at: {}'.format(self.dir_name)
        print '(1) Sum Lines Lengths in a DWG to MS-Excel'
        print '(2) Sum Areas in a DWG to MS-Excel'
        print '(3) Count Blocks in a DWG to MS-Excel'
        print '(4) Count Blocks per layer in a DWG'
        user_chose = raw_input('Please choose what to do [1,2,3,4]: ')
        if user_chose == '1':
            user_string = raw_input(
                'Enter a string to search in layer names: ')
            user_units = raw_input('Drawing units (m / [cm] / mm):')
            if not user_units:
                user_units = 'cm'
            beaverAutoCAD_core.line_lengths_excel(
                filename='AAC_lines_{}'.format(self.filename),
                savingPath=self.dir_name,
                draw_units=user_units,
                layers_contain=user_string)
            print 'Done.'
        elif user_chose == '2':
            user_string = raw_input(
                'Enter a string to search in layer names: ')
            user_units = raw_input('Drawing units (m / [cm] / mm):')
            if not user_units:
                user_units = 'cm'
            beaverAutoCAD_core.sum_areas_excel(filename='AAC_areas_{}'.format(
                self.filename),
                                               savingPath=self.dir_name,
                                               draw_units=user_units,
                                               layers_contain=user_string)
            print 'Done.'

        elif user_chose == '3':
            user_string_layers = raw_input(
                'Enter a string to search in layer names: ')
            user_string_blocks = raw_input(
                'Enter a string to search in block names: ')
            user_layer0 = raw_input('Use layer 0? y/[n]')
            if not user_layer0 or user_layer0.lower() == 'n':
                user_layer0 = 'no'
            else:
                user_layer0 = 'yes'
            beaverAutoCAD_core.count_blocks_excel(
                filename="AAC_blocks_{}".format(self.filename),
                savingPath=self.dir_name,
                uselayer0=user_layer0,
                layers_contain=user_string_layers,
                blocks_contain=user_string_blocks)
            print 'Done.'
        elif user_chose == '4':
            user_string_layers = raw_input(
                'Enter a string to search in layer names: ')
            user_string_blocks = raw_input(
                'Enter a string to search in block names: ')
            user_layer0 = raw_input('Use layer 0? y/[n]')
            if not user_layer0 or user_layer0.lower() == 'n':
                user_layer0 = 'no'
            else:
                user_layer0 = 'yes'
            beaverAutoCAD_core.count_blocks_per_layer(
                filename="AAC_blocks_per_layer_{}".format(self.filename),
                savingPath=self.dir_name,
                uselayer0=user_layer0,
                layers_contain=user_string_layers,
                blocks_contain=user_string_blocks)
            print 'Done.'
        else:
            print 'No option was chosen. Goodbye!'
        print """