X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=functions.py;h=62f669ce24d0ee52a58780313a183b7d0c1aff53;hp=6373176e139c69407c57c940e74d3399f7082157;hb=2560c66bef5e023dbce18c556363ec956bd15e47;hpb=773ca4248f17f17098e34b3c21004713e09e3109 diff --git a/functions.py b/functions.py index 6373176..62f669c 100644 --- a/functions.py +++ b/functions.py @@ -30,6 +30,14 @@ log = logging.getLogger('iramuteq') indices_simi = [u'cooccurrence' ,'pourcentage de cooccurrence',u'Russel',u'Jaccard', 'Kulczynski1', 'Kulczynski2', 'Mountford', 'Fager', 'simple matching', 'Hamman', 'Faith', 'Tanimoto', 'Dice', 'Phi', 'Stiles', 'Michael', 'Mozley', 'Yule', 'Yule2', 'Ochiai', 'Simpson', 'Braun-Blanquet','Chi-squared', 'Phi-squared', 'Tschuprow', 'Cramer', 'Pearson', 'binomial'] + +def open_folder(folder): + if sys.platform == "win32": + os.startfile(folder) + else: + opener ="open" if sys.platform == "darwin" else "xdg-open" + call([opener, folder]) + def normpath_win32(path) : if not sys.platform == 'win32' : return path @@ -306,7 +314,7 @@ def write_tab(tab, fileout) : class BugDialog(wx.Dialog): def __init__(self, *args, **kwds): # begin wxGlade: MyDialog.__init__ - kwds["style"] = wx.DEFAULT_DIALOG_STYLE + kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP kwds["size"] = wx.Size(500, 200) wx.Dialog.__init__(self, *args, **kwds) self.SetTitle(kwds['title']) @@ -695,21 +703,21 @@ def read_list_file(filename, encoding = sys.getdefaultencoding()): def progressbar(self, maxi) : - if 'parent' in dir(self) : - parent = self.parent - else : - parent = self + ira = wx.GetApp().GetTopWindow() + parent = ira try : maxi = int(maxi) except : maxi = 1 - return wx.ProgressDialog("Traitements", + prog = wx.ProgressDialog("Traitements", "Veuillez patienter...", maximum=maxi, parent=parent, style=wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME | wx.PD_CAN_ABORT ) - + prog.SetSize((400,150)) + prog.SetIcon(ira._icon) + return prog def treat_var_mod(variables) : var_mod = {}