HEX
Server: LiteSpeed
System: Linux srv1.dhviews.com 5.14.0-570.23.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 24 11:27:16 EDT 2025 x86_64
User: bdedition (1723)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //proc/self/root/proc/self/root/usr/local/lib/python3.9/site-packages/wordfence/cli/terms/terms.py
from ...util import caching
from ...logging import log
from ..subcommands import Subcommand
from ..mailing_lists import EMAIL_SIGNUP_MESSAGE


class TermsSubcommand(Subcommand):

    def fetch_terms(self) -> str:
        client = self.context.create_noc1_client(use_hooks=False)
        return client.get_terms()

    def get_terms(self) -> str:
        cacheable = caching.Cacheable(
                'terms',
                self.fetch_terms,
                caching.DURATION_ONE_DAY
            )
        return cacheable.get(self.cache)

    def invoke(self) -> int:
        terms = self.get_terms()
        print(terms)
        log.info(EMAIL_SIGNUP_MESSAGE)
        return 0


factory = TermsSubcommand