def setup_method(self, method): self.main_window = MainWindow(None, -1) self.grid = self.main_window.grid self.code_array = self.grid.code_array filepath = TESTPATH + 'test_txt.csv' self.txtgen = TxtGenerator(self.main_window, filepath)
def setup_method(self, method): self.main_window = MainWindow(None, title="pyspread", S=None) self.grid = self.main_window.grid self.code_array = self.grid.code_array # Filenames # --------- # File with valid signature self.filename_valid_sig = TESTPATH + "test1.pys" self.grid.actions.sign_file(self.filename_valid_sig) # File without signature self.filename_no_sig = TESTPATH + "test2.pys" # File with invalid signature self.filename_invalid_sig = TESTPATH + "test3.pys" # File for self.grid size test self.filename_gridsize = TESTPATH + "test4.pys" self.grid.actions.sign_file(self.filename_gridsize) # Empty file self.filename_empty = TESTPATH + "test5.pys" # File name that cannot be accessed self.filename_not_permitted = TESTPATH + "test6.pys" # File name without file self.filename_wrong = TESTPATH + "test-1.pys" # File for testing save self.filename_save = TESTPATH + "test_save.pys"
def setup_method(self, method): self.main_window = MainWindow(None, title="pyspread", S=None) self.grid = self.main_window.grid self.code_array = self.grid.code_array self.test_filename = TESTPATH + "test.csv" self.test_filename2 = TESTPATH + "test_one_col.csv" self.test_filename3 = TESTPATH + "test_write.csv"
def setup_method(self, method): self.main_window = MainWindow(None, -1) self.grid = self.main_window.grid self.code_array = self.grid.code_array self.test_filename = TESTPATH + "test.csv" self.test_filename_single_col = TESTPATH + "large.txt" self.test_filename_notthere = TESTPATH + "notthere.txt" self.test_filename_bin = TESTPATH + "test1.pys"
def setup_method(self, method): self.main_window = MainWindow(None, -1) self.grid = self.main_window.grid self.code_array = self.grid.code_array filepath = TESTPATH + 'test1.csv' self.dialect, __ = sniff(filepath) self.digest_types = [types.UnicodeType] has_header = True self.interface = CsvInterface(self.main_window, filepath, self.dialect, self.digest_types, has_header)
def setup_method(self, method): self.main_window = MainWindow(None, -1) self.grid = self.main_window.grid self.code_array = self.grid.code_array # Content for find and replace operations grid_data = { (0, 0, 0): u"Test", (1, 0, 0): u"Test1", (2, 0, 0): u"Test2", } for key in grid_data: self.grid.code_array[key] = grid_data[key]
def OnInit(self): """Init class that is automatically run on __init__""" # Get command line options and arguments cmdp = Commandlineparser() options, filename = cmdp.parse() kwargs = {"title": "pyspread", "S": self.S} # Store command line input in config if no file is provided if filename is None: kwargs["dimensions"] = options.dimensions # Main window creation from src.gui._main_window import MainWindow self.main_window = MainWindow(None, **kwargs) # Initialize file loading via event if options.new_gpgkey: # Create GPG key if not present try: from src.lib.gpg import genkey self.config["gpg_key_fingerprint"] = repr("") genkey() except ImportError: pass except ValueError: # python-gnupg is installed but gnupg is not installed pass # Show application window self.SetTopWindow(self.main_window) self.main_window.Show() # Load filename if provided if filename is not None: post_command_event(self.main_window, self.GridActionOpenMsg, attr={"filepath": filename}) self.main_window.filepath = filename return True
def setup_method(self, method): # Generate a GPG key if not present if fingerprint2keyid(config["gpg_key_fingerprint"]) is None and \ genkey is not None: # No GPG key is configured self.fingerprint = genkey(key_name="pyspread_test_key") else: # Use preconfigured key self.fingerprint = config["gpg_key_fingerprint"] self.main_window = MainWindow(None, title="pyspread", S=None) self.grid = self.main_window.grid self.code_array = self.grid.code_array # Sign files in order to get valid signatures for current key self.grid.actions.sign_file(self.filename_valid_sig) self.grid.actions.sign_file(self.filename_gridsize)
def OnInit(self): """Init class that is automatically run on __init__""" # Get command line options and arguments self.get_cmd_args() # Initialize the prerequisitions to construct the main window wx.InitAllImageHandlers() # Main window creation from src.gui._main_window import MainWindow self.main_window = MainWindow(None, title="pyspread", S=self.S) ## Initialize file loading via event # Create GPG key if not present try: from src.lib.gpg import genkey genkey() except ImportError: pass except ValueError: # python-gnupg is installed but gnupg is not insatlled pass # Show application window self.SetTopWindow(self.main_window) self.main_window.Show() # Load filename if provided if self.filepath is not None: post_command_event(self.main_window, self.GridActionOpenMsg, attr={"filepath": self.filepath}) self.main_window.filepath = self.filepath return True
def setup_method(self, method): self.main_window = MainWindow(None, -1) self.grid = self.main_window.grid
def setup_method(self, method): self.main_window = MainWindow(None, title="pyspread", S=None) self.grid = self.main_window.grid self.code_array = self.grid.code_array