Exemplo n.º 1
0
 def start_description_block(self, tag, attrs):
     j = attrs.get("join", None)
     if j is None:
         self.join_fctn = Decode.join_fixspaces
     else:
         self.join_fctn = Decode.make_typechecked_decoder(j, list, str)
     self.descriptions = []
Exemplo n.º 2
0
 def end_hsp_value(self, tag):
     s = self.get_characters()
     if self.value_name is not None:
         if self.value_name == "float":
             s = float(s)
         else:
             s = Decode.make_decoder(self.value_convert)(s)
     self.hsp_values[self.value_name] = s
Exemplo n.º 3
0
    def start_feature_block(self, tag, attrs):
        jf = attrs.get("join-description", None)
        if jf is None:
            self.join_feature_description = Decode.join_fixspaces
        else:
            self.join_feature_description = Decode.make_typechecked_decoder(
                jf, list, str)

        self.settings["location-style"] = attrs.get("location-style", None)

        jq = attrs.get("join-qualifier", None)
        if jq is None:
            self.settings["qualifier_join_func"] = Decode.join_fixspaces
        else:
            self.settings["qualifier_join_func"] = \
                          Decode.make_typechecked_decoder(jq, list, str)
        self.features = []
Exemplo n.º 4
0
 def start_feature_qualifier(self, tag, attrs):
     self.name = None
     self.description = []
     qj = attrs.get("join-qualifier", None)
     if qj is None:
         self.join = self.settings["qualifier_join_func"]
     else:
         self.join = Decode.make_typechecked_decoder(qj, list, str)
Exemplo n.º 5
0
 def start_sequence_block(self, tag, attrs):
     self.local_alphabet = attrs.get("alphabet", None)
     self.gapchar = attrs.get("gapchar", None)
     self.stopchar = attrs.get("stopchar", None)
     j = attrs.get("join", None)
     if j is not None:
         self.join_func = Decode.make_typechecked_decoder(j, list, str)
     else:
         self.join_func = None
     self.sequences = []
Exemplo n.º 6
0
 def end_search_table_value(self, tag):
     s = self.get_characters()
     if self.value_decode is not None:
         x = self.value_decode
         if x == "int":
             s = int(s)
         elif x == "float":
             s = float(s)
         else:
             s = Decode.make_decoder(x)(s)
     self.values[self.value_name] = s
Exemplo n.º 7
0
    def start_feature(self, tag, attrs):
        self.location_style = attrs.get("location-style",
                                        self.settings["location-style"])
        j = attrs.get("join-feature", None)
        if j is None:
            self.text_join_func = "".join
        else:
            self.text_join_func = Decode.make_typechecked_decoder(j, list, str)

        self.location_start = None
        self.location_end = None
        self.text_lines = []