コード例 #1
0
    def get_full_desat_hhmmss(self):
        """Return full desat time (if calculated) in hhmmss format.

        instead of an int in seconds

        :returns: "hh:mm:ss" full desat time
        :rtype: str
        """
        if self.full_desat_time_value is not None:
            return seconds_to_hhmmss(self.full_desat_time_value)
        else:
            return seconds_to_hhmmss(self.full_desat_time())
コード例 #2
0
ファイル: dive.py プロジェクト: ThomasChiroux/dipplanner
    def get_full_desat_hhmmss(self):
        """Return full desat time (if calculated) in hhmmss format.

        instead of an int in seconds

        :returns: "hh:mm:ss" full desat time
        :rtype: str
        """
        if self.full_desat_time_value is not None:
            return seconds_to_hhmmss(self.full_desat_time_value)
        else:
            return seconds_to_hhmmss(self.full_desat_time())
コード例 #3
0
ファイル: tools_test.py プロジェクト: hordurk/dipplanner
 def test_seconds_to_hhmmss_5(self):
     try:
         result = seconds_to_hhmmss(-10)
     except ValueError:
         pass
     else:
         self.fail('should raise ValueError')
コード例 #4
0
 def test_seconds_to_hhmmss_5(self):
     try:
         _ = seconds_to_hhmmss(-10)
     except ValueError:
         pass
     else:
         self.fail('should raise ValueError')
コード例 #5
0
ファイル: dive.py プロジェクト: ThomasChiroux/dipplanner
    def get_no_flight_hhmmss(self):
        """Return no flight time (if calculated) in hhmmss format.

        instead of an int in seconds

        .. note::

           This method does not calculate no_flight_time
           you need to call no_flight_time() or
           no_flight_time_wo_exception() before.

        :returns: "hh:mm:ss" no flight time
                  "" (empty string) if no flight time is not calculated
        :rtype: str
        """
        if self.no_flight_time_value is not None:
            return seconds_to_hhmmss(self.no_flight_time_value)
        else:
            return ""
コード例 #6
0
    def get_no_flight_hhmmss(self):
        """Return no flight time (if calculated) in hhmmss format.

        instead of an int in seconds

        .. note::

           This method does not calculate no_flight_time
           you need to call no_flight_time() or
           no_flight_time_wo_exception() before.

        :returns: "hh:mm:ss" no flight time
                  "" (empty string) if no flight time is not calculated
        :rtype: str
        """
        if self.no_flight_time_value is not None:
            return seconds_to_hhmmss(self.no_flight_time_value)
        else:
            return ""
コード例 #7
0
ファイル: dive.py プロジェクト: hordurk/dipplanner
    def get_no_flight_hhmmss(self):
        """Returns no flight time (if calculated) in hhmmss format
        instead of an int in seconds

        .. note::

           This method does not calculate no_flight_time
           you need to call no_flight_time() or
           no_flight_time_wo_exception() before.

        *Keyword Arguments:*
            <none>

        Returns:
            str -- "hh:mm:ss" no flight time
            str -- "" if no flight time is not calculated
        """
        if self.no_flight_time_value is not None:
            return seconds_to_hhmmss(self.no_flight_time_value)
        else:
            return ""
コード例 #8
0
ファイル: tools_test.py プロジェクト: hordurk/dipplanner
 def test_seconds_to_hhmmss_4(self):
     self.assertEqual(seconds_to_hhmmss(447851), "124:24:11",
         "Wrong output for seconds to hhmmss: %s"
         % seconds_to_hhmmss(447851))
コード例 #9
0
ファイル: tools_test.py プロジェクト: hordurk/dipplanner
 def test_seconds_to_hhmmss_3(self):
     self.assertEqual(seconds_to_hhmmss(875), "00:14:35",
         "Wrong output for seconds to hhmmss: %s"
         % seconds_to_hhmmss(875))
コード例 #10
0
ファイル: tools_test.py プロジェクト: hordurk/dipplanner
 def test_seconds_to_hhmmss_2(self):
     self.assertEqual(seconds_to_hhmmss(100), "00:01:40",
         "Wrong output for seconds to hhmmss: %s"
         % seconds_to_hhmmss(100))
コード例 #11
0
 def test_seconds_to_hhmmss_4(self):
     self.assertEqual(
         seconds_to_hhmmss(447851), "124:24:11",
         "Wrong output for seconds to hhmmss: %s" %
         seconds_to_hhmmss(447851))
コード例 #12
0
 def test_seconds_to_hhmmss_3(self):
     self.assertEqual(
         seconds_to_hhmmss(875), "00:14:35",
         "Wrong output for seconds to hhmmss: %s" % seconds_to_hhmmss(875))
コード例 #13
0
 def test_seconds_to_hhmmss_2(self):
     self.assertEqual(
         seconds_to_hhmmss(100), "00:01:40",
         "Wrong output for seconds to hhmmss: %s" % seconds_to_hhmmss(100))