Esempio n. 1
0
    def dump(self):
        p = paths.hidden_path('analysis_sets')
        if self._analysis_sets:
            with open(p, 'w') as wfile:
                json.dump(self._analysis_sets, wfile)

        p = paths.hidden_path('selected_analysis_set')
        if self.analysis_set:
            with open(p, 'w') as wfile:
                wfile.write(self.analysis_set)
Esempio n. 2
0
    def dump(self):
        p = paths.hidden_path('analysis_sets')
        if self._analysis_sets:
            with open(p, 'w') as wfile:
                json.dump(self._analysis_sets, wfile)

        p = paths.hidden_path('selected_analysis_set')
        if self.analysis_set:
            with open(p, 'w') as wfile:
                wfile.write(self.analysis_set)
Esempio n. 3
0
 def load(self):
     p = paths.hidden_path('analysis_sets')
     if os.path.isfile(p):
         with open(p, 'r') as rfile:
             jd = json.load(rfile, object_pairs_hook=OrderedDict)
             self._analysis_sets = jd
             self.analysis_set_names = list(reversed([ji[0] for ji in jd.values()]))
 def load(self):
     p = paths.hidden_path('analysis_sets')
     if os.path.isfile(p):
         with open(p, 'r') as rfile:
             jd = json.load(rfile, object_pairs_hook=OrderedDict)
             self._analysis_sets = jd
             self.analysis_set_names = list(
                 reversed([ji[0] for ji in jd.values()]))
Esempio n. 5
0
    def load(self):
        p = paths.hidden_path('analysis_sets')
        if os.path.isfile(p):
            with open(p, 'r') as rfile:
                try:
                    jd = json.load(rfile, object_pairs_hook=OrderedDict)
                except ValueError as e:
                    print('load sanlaysis set exception', e)
                    return

                self._analysis_sets = jd
                self.analysis_set_names = list(reversed([ji[0] for ji in jd.values()]))

        p = paths.hidden_path('selected_analysis_set')
        if os.path.isfile(p):
            with open(p, 'r') as rfile:
                self.analysis_set = rfile.read().strip()
Esempio n. 6
0
 def perform(self, event):
     from pychron.paths import paths
     p = paths.hidden_path('analysis_sets')
     if os.path.isfile(p):
         if confirm(None, 'Are you sure you want to clear the Analysis Sets?') == YES:
             os.remove(p)
     else:
         information(None, 'No Analysis Sets to remove')
Esempio n. 7
0
 def perform(self, event):
     from pychron.paths import paths
     p = paths.hidden_path('analysis_sets')
     if os.path.isfile(p):
         if confirm(None, 'Are you sure you want to clear the Analysis Sets?') == YES:
             os.remove(p)
     else:
         information(None, 'No Analysis Sets to remove')
Esempio n. 8
0
    def load(self):
        p = paths.hidden_path('analysis_sets')
        if os.path.isfile(p):
            with open(p, 'r') as rfile:
                try:
                    jd = json.load(rfile, object_pairs_hook=OrderedDict)
                except ValueError as e:
                    print('load sanlaysis set exception', e)
                    return

                self._analysis_sets = jd
                self.analysis_set_names = list(
                    reversed([ji[0] for ji in jd.values()]))

        p = paths.hidden_path('selected_analysis_set')
        if os.path.isfile(p):
            with open(p, 'r') as rfile:
                self.analysis_set = rfile.read().strip()
 def dump(self):
     p = paths.hidden_path('analysis_sets')
     with open(p, 'w') as wfile:
         json.dump(self._analysis_sets, wfile)
Esempio n. 10
0
 def _dump_configuration(self):
     p = paths.hidden_path('diff_config')
     with open(p, 'w') as wfile:
         return yaml.dump(self.diff_tags, wfile)
Esempio n. 11
0
 def _get_configuration(self):
     p = paths.hidden_path('diff_config')
     if os.path.isfile(p):
         with open(p, 'r') as rfile:
             return yaml.load(rfile)
Esempio n. 12
0
 def add_search_entry(self):
     p = paths.hidden_path('search_entries')
     with open(p, 'w') as wfile:
         if self.search_entry not in self.search_entries:
             self.search_entries.append(self.search_entry)
             yaml.dump([str(s) for s in self.search_entries], wfile)
Esempio n. 13
0
 def _load_entries(self):
     p = paths.hidden_path('search_entries')
     if os.path.isfile(p):
         with open(p, 'r') as rfile:
             self.search_entries = yaml.load(rfile)
Esempio n. 14
0
 def _dump_configuration(self):
     p = paths.hidden_path('diff_config')
     with open(p, 'w') as wfile:
         return yaml.dump(self.diff_tags, wfile)
Esempio n. 15
0
 def _get_configuration(self):
     p = paths.hidden_path('diff_config')
     if os.path.isfile(p):
         with open(p, 'r') as rfile:
             return yaml.load(rfile)
Esempio n. 16
0
 def dump(self):
     p = paths.hidden_path('analysis_sets')
     with open(p, 'w') as wfile:
         json.dump(self._analysis_sets, wfile)