コード例 #1
0
    def generate_periods(self):
        cycle_1_start = 0
        cycle_1_value = simplify(self.birth.month)
        cycle_1_example = examplify(
            tranz("g.month"),
            "%02d" % self.birth.month,
            cycle_1_value
        )

        cycle_2_start = 28
        cycle_2_value = simplify(self.birth.day)
        cycle_2_example = examplify(
            tranz("g.day"),
            "%02d" % self.birth.day,
            cycle_2_value
        )

        cycle_3_start = 56
        cycle_3_value = simplify(self.birth.year)
        cycle_3_example = examplify(
            tranz("g.year"),
            "%04d" % self.birth.year,
            cycle_3_value
        )

        periods = [
            create_period(cycle_1_start, cycle_1_value, cycle_1_example),
            create_period(cycle_2_start, cycle_2_value, cycle_2_example),
            create_period(cycle_3_start, cycle_3_value, cycle_3_example)
        ]

        return periods
コード例 #2
0
    def generate_periods(self):
        """ Return the periods and content of the actions """

        life_path = LifePath(self.person).result
        life_path = simplify(life_path, keep_power=False)

        action_1_start = 0
        action_1_value = simplify(self.birth.month + self.birth.day)
        action_1_example = examplify(
            "%s + %s" % (tranz("g.month"), tranz("g.day")),
            "%02d + %02d" % (self.birth.month, self.birth.day),
            action_1_value
        )

        action_2_start = 36 - life_path
        action_2_value = simplify(self.birth.year + self.birth.day)
        action_2_example = examplify(
            "%s + %s" % (tranz("g.year"), tranz("g.day")),
            "%04d + %02d" % (self.birth.year, self.birth.day),
            action_2_value
        )

        action_3_start = action_2_start + 9
        action_3_value = simplify(
            simplify(action_1_value, keep_power=False) +
            simplify(action_2_value, keep_power=False)
        )
        action_3_example = examplify(
            "%s + %s" % (tranz("g.action_1"), tranz("g.action_2")),
            "%d + %d" % (action_1_value, action_2_value),
            action_3_value
        )

        action_4_start = action_3_start + 9
        action_4_value = simplify(self.birth.year + self.birth.month)
        action_4_example = examplify(
            "%s + %s" % (tranz("g.year"), tranz("g.month")),
            "%04d + %02d" % (self.birth.year, self.birth.month),
            action_4_value
        )

        periods = [
            create_period(action_1_start, action_1_value, action_1_example),
            create_period(action_2_start, action_2_value, action_2_example),
            create_period(action_3_start, action_3_value, action_3_example),
            create_period(action_4_start, action_4_value, action_4_example),
        ]
        return periods
コード例 #3
0
 def test_examplify_with_symbol(self):
     """ Examplifying should be possible with a different symbol """
     string = "John Doe"
     numbers = "1685 465"
     res = 8
     expected = ["JOHN DOE", "1685 465 gives 8"]
     self.assertEqual(expected, utils.examplify(string, numbers, res, "gives"))
コード例 #4
0
 def test_examplify(self):
     """ Examplifying should give the expected format """
     string = "John Doe"
     numbers = "1685 465"
     res = 8
     expected = ["JOHN DOE", "1685 465 → 8"]
     self.assertEqual(expected, utils.examplify(string, numbers, res))
コード例 #5
0
    def run(self):
        year, month, day = self.today.year + 1, self.birth.month, self.birth.day
        num = utils.simplify(year + month + day, keep_power=False)
        self._result = num

        # Compute the example
        formatted_birth = "%s + %s + %s" % (tranz("g.u_year"),
                                            tranz("g.month"), tranz("g.day"))
        formatted_sum = "%04d + %02d + %02d" % (year, month, day)
        self._example = utils.examplify(formatted_birth, formatted_sum,
                                        self._result)
コード例 #6
0
ファイル: lifepath.py プロジェクト: jlebonzec/newmerology
    def run(self):
        year, month, day = self.birth.year, self.birth.month, self.birth.day
        num = utils.simplify(year + month + day)
        if num not in POWERS:
            # Try another way to find the power number
            num = utils.simplify(
                utils.simplify(year, keep_power=False) +
                utils.simplify(month, keep_power=False) +
                utils.simplify(day, keep_power=False))
        self._result = num

        # Compute the example
        formatted_birth = "%s + %s + %s" % (tranz("g.year"), tranz("g.month"),
                                            tranz("g.day"))
        formatted_sum = "%04d + %02d + %02d" % (year, month, day)
        self._example = utils.examplify(formatted_birth, formatted_sum,
                                        self._result)
コード例 #7
0
    def grid(self):
        """ Generate the grid if needed and return it """
        if not self._grid:
            self._grid = {}
            digits = digitize(self.full_name)

            size = self.width * self.height + 1
            for i in range(1, size):
                count, explanation = count_occurrences(digits, i, explain=True)
                example = examplify(self.full_name, explanation, count)

                self._grid[i] = {
                    'count': count,
                    'example': example,
                }

            cache.set(self._cache_key, self._grid)
        return self._grid
コード例 #8
0
ファイル: intimate.py プロジェクト: jlebonzec/newmerology
    def run(self):
        consonants = re.sub(re_vowels, '_', self.full_name)
        digits = utils.digitize(consonants)

        self._result = utils.simplify(digits)
        self._example = utils.examplify(consonants, digits, self._result)
コード例 #9
0
ファイル: heredity.py プロジェクト: jlebonzec/newmerology
    def run(self):
        digits = utils.digitize(self.last_name)

        self._result = utils.simplify(digits)
        self._example = utils.examplify(self.last_name, digits, self._result)
コード例 #10
0
ファイル: active.py プロジェクト: jlebonzec/newmerology
    def run(self):
        digits = utils.digitize(self.given_names)

        self._result = utils.simplify(digits)
        self._example = utils.examplify(self.given_names, digits, self._result)