Grammalecte  Check-in [c88678ec25]

Overview
Comment:[lo] update: text formatter uses helpers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | lo | multid
Files: files | file ages | folders
SHA3-256: c88678ec25defa7f005c924d63e8ae17500fee2db54293a9c138438f72bae9ca
User & Date: olr on 2018-02-19 12:38:07
Other Links: branch diff | manifest | tags
Context
2018-02-19
12:39
[lo] remove print check-in: a6c452056b user: olr tags: lo, multid
12:38
[lo] update: text formatter uses helpers check-in: c88678ec25 user: olr tags: lo, multid
12:37
[lo] update: helpers check-in: 12ad381687 user: olr tags: lo, multid
Changes

Modified gc_lang/fr/oxt/TextFormatter/TextFormatter.py from [6fb58f6672] to [652166f86d].

381
382
383
384
385
386
387
388
389
390
391
392
393
394

395

396
397
398
399
400
401
402
            # create options dictionary
            dOpt = {}
            for key, lWidget in self.dCheckboxWidgets.items():
                w = getattr(self, key)
                dOpt[w.Name] = w.State
                for w in lWidget:
                    dOpt[w.Name] = w.State
            # get extension path
            xDefaultContext = self.ctx.ServiceManager.DefaultContext
            xPackageInfoProvider = xDefaultContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider")
            sExtPath = xPackageInfoProvider.getPackageLocation("French.linguistic.resources.from.Dicollecte.by.OlivierR")
            sExtPath = sExtPath[8:] + "/pythonpath/tf_options.py"  # remove "file:///"
            sExtPath = os.path.abspath(sExtPath)
            # write file

            if os.path.isfile(sExtPath):

                hOpt = open(sExtPath, "w")
                hOpt.write("dDefaultOpt = " + str(tf_options.dDefaultOpt) + "\n")
                hOpt.write("dOpt = " + str(dOpt))
                hOpt.close()
        except:
            traceback.print_exc()








<
<
<
<
<
<

>

>







381
382
383
384
385
386
387






388
389
390
391
392
393
394
395
396
397
398
            # create options dictionary
            dOpt = {}
            for key, lWidget in self.dCheckboxWidgets.items():
                w = getattr(self, key)
                dOpt[w.Name] = w.State
                for w in lWidget:
                    dOpt[w.Name] = w.State






            # write file
            sExtPath = helpers.getAbsolutePathOf("/pythonpath/tf_options.py")
            if os.path.isfile(sExtPath):
                print(sExtPath)
                hOpt = open(sExtPath, "w")
                hOpt.write("dDefaultOpt = " + str(tf_options.dDefaultOpt) + "\n")
                hOpt.write("dOpt = " + str(dOpt))
                hOpt.close()
        except:
            traceback.print_exc()