diff --git a/.travis.yml b/.travis.yml index 15f50f3..af6b2d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,14 @@ language: bash before_install: sudo apt-get install python-tk language: python -python: 2.7 -install: python2 setup -t +python: + - 2.7 + - 3.5 + - 3.9 +install: + - python --version + - pip install coverage + - python setup -t services: - xvfb @@ -12,4 +18,9 @@ before_script: - "export DISPLAY=:99.0" - sleep 3 # give xvfb some time to start -script: ./run +script: + - python run + - coverage run -m unittest discover + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/LICENSE b/LICENSE index eaaff3b..16f2774 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Hernan Chavez Thielemann +Copyright (c) 2018-2021 Hernan Chavez Thielemann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 5417746..478790d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ - -python 2.7: [![Build Status](https://travis-ci.org/hernanchavezthielemann/GRO2LAM.svg?branch=27ene19)](https://travis-ci.org/hernanchavezthielemann/GRO2LAM) +python 2.7 & 3.5-3.9: [![Build Status](https://travis-ci.com/hernanchavezthielemann/GRO2LAM.svg?branch=py3_compatibility)](https://travis-ci.com/hernanchavezthielemann/GRO2LAM) +python 2.7 & 3.5-3.9: [![Build Status](https://travis-ci.org/hernanchavezthielemann/GRO2LAM.svg?branch=py3_compatibility)](https://travis-ci.org/hernanchavezthielemann/GRO2LAM) # GRO2LAM Gromacs to Lammps simulation converter diff --git a/lib/grotolam.py b/lib/grotolam.py index 9243f26..c84dd48 100644 --- a/lib/grotolam.py +++ b/lib/grotolam.py @@ -3,6 +3,7 @@ from lib.misc.version import __version__ from lib.misc.file import write_file from lib.gui.main_gui import launch_gui +from lib.misc.display import show class Grotolam(object): def __init__(self, master=None): @@ -27,14 +28,14 @@ def grotolam_launcher(): ''' at this point this is just the name, quite deceptive ;) maybe can call directly the GUI in the future, but this handles the library''' - print '\n'+' '*20+__version__+'\n' + show( '\n' + ' '*20 + __version__ + '\n') launch_gui() def grotolam_launcher_test(): - print '-'*21+' TESTING '+'-'*21+'\n\n' - print '\n'+' '*20+__version__+'\n' + show( '-'*21 + ' TESTING ' + '-'*21 + '\n\n') + show( '\n' + ' '*20 + __version__ + '\n') launch_gui( True) #conv_data, ckbuttons, solva_tags,_quit_flag_ = launch_gui() diff --git a/lib/gui/__init__.pyc b/lib/gui/__init__.pyc new file mode 100644 index 0000000..6682dd6 Binary files /dev/null and b/lib/gui/__init__.pyc differ diff --git a/lib/gui/conversion_gui.py b/lib/gui/conversion_gui.py index 9683bf7..ab9fed8 100644 --- a/lib/gui/conversion_gui.py +++ b/lib/gui/conversion_gui.py @@ -7,13 +7,13 @@ #/// Packages and globals definitions are here /// #------------------------------------------------------ -from Tkinter import Frame, Label, StringVar, Button # , IntVar +from lib.gui.tk_lib import Frame, Label, StringVar, Button # , IntVar +from lib.gui.tk_lib import bottom_hline_deco, format_dec, Drop_Down_List +from lib.gui.tk_lib import createmenubar, create_entry, get_entriesvalue +from lib.gui.custom_row import File_Entry -from tk_lib import bottom_hline_deco, format_dec, Drop_Down_List -from tk_lib import createmenubar, create_entry, get_entriesvalue -from custom_row import File_Entry - -from lib.misc.warn import print_dec_g, pop_wrg_1, pop_err_1 +from lib.misc.display import show_in_green, show +from lib.misc.warn import pop_wrg_1, pop_err_1 from lib.misc.file import check_file, check_in_file from lib.handling.gromacs import extract_gromacs_data, get_ffldfiles @@ -59,7 +59,7 @@ def create_conversion_gui(self): _atomstyle_ = 'full' data_cont = self.master._convert_['setup'] - if data_cont <> []: + if data_cont != []: _autoload_ = data_cont[0] eg_files = data_cont[1:-1] _atomstyle_ = data_cont[-1] @@ -125,7 +125,7 @@ def create_conversion_gui(self): ###### END CONSTRUCTION SITE -> PACK OUTSIDE ######### if self.master.test: - print 'Seeing main gro2lam converter GUI' + show( 'Seeing main gro2lam converter GUI') self.after(2000, self.test_hook ) def atomstyle( self): @@ -186,7 +186,7 @@ def autoloadstuff(self): #_autoload_ = self.objt_c[0].get() main_top_file = self.objt_c[2].get() - if self.autoload_buffer <> main_top_file: + if self.autoload_buffer != main_top_file: # self.autoload_buffer = _autoload_ self.autoload_buffer = main_top_file aux_cont, nonerr_flag = get_ffldfiles( main_top_file ) @@ -219,9 +219,9 @@ def load_top_file( self, *args ):#event=None, in order to avoid the the waving experienced with a first "''" in the entry an if is inside ''' - #print args - if self.objt_c[2].get() <> '': - #print ( self.objt_c[2].get()) + #show( args + if self.objt_c[2].get() != '': + #show( ( self.objt_c[2].get()) self.autol_b.configure( state = 'normal') for i in [2, 3, 4]: @@ -252,7 +252,7 @@ def getdata_and_convert(self): data_cont = self.master._convert_['setup'] root_folder = '/'.join(data_cont[1].split('/')[:-1]+['']) - print( 'Root folder: {}'.format( root_folder) ) + show( 'Root folder: {}'.format( root_folder) ) sim_data, _flags_ = extract_gromacs_data( data_cont[1:-1], _autoload_) @@ -279,7 +279,7 @@ def getdata_and_convert(self): flag_done_ = False if flag_done_: - print_dec_g( 'Data file generated as "data.gro2lam"' ) + show_in_green( 'Data file generated as "data.gro2lam"' ) self._convertdata_ = sim_data self._convertdata_['filename'] = data_fnam diff --git a/lib/gui/custom_row.py b/lib/gui/custom_row.py index 5b438c6..737fdaf 100644 --- a/lib/gui/custom_row.py +++ b/lib/gui/custom_row.py @@ -2,9 +2,9 @@ # By Hernan Chavez Thielemann __author__ = 'Hernan Chavez Thielemann ' -from Tkinter import Entry, Button, Frame, StringVar -from tk_lib import format_dec -from popup import FilePopUp +from lib.gui.tk_lib import Entry, Button, Frame, StringVar, format_dec +from lib.misc.display import show +from lib.gui.popup import FilePopUp class File_Entry(Frame): @@ -85,8 +85,8 @@ def browsefile(self, entry, ext=None): '''Browse a file