~lioploum/offpunk

8b97acc5e0be1c46331b6e5741f1fa4580b0d691 — Lionel Dricot 8 months ago 963ac3d tentative
relative import back to offpunk
A offpunk.py => offpunk.py +3 -0
@@ 0,0 1,3 @@
#!/usr/bin/env python3
from offpunk import main
main()

M offpunk/__init__.py => offpunk/__init__.py +6 -6
@@ 21,9 21,9 @@ import sys
import time
import urllib.parse
import subprocess
from . import ansicat, netcache, opnk, themes
from .utils import run,term_width,is_local,mode_url,unmode_url
from .utils import _CONFIG_DIR,_DATA_DIR,_CACHE_PATH
from offpunk import ansicat, netcache, opnk, themes
from offpunk.utils import run,term_width,is_local,mode_url,unmode_url
from offpunk.utils import _CONFIG_DIR,_DATA_DIR,_CACHE_PATH
try:
    import setproctitle
    setproctitle.setproctitle("offpunk")


@@ 138,7 138,7 @@ class GeminiClient(cmd.Cmd):
        # type sensitivie information.
        os.umask(0o077)
        self.opencache = opnk.opencache()
        self.theme = offthemes.default
        self.theme = themes.default
        self.prompt = self.set_prompt("ON")
        self.current_url = None
        self.hist_index = 0


@@ 205,8 205,8 @@ class GeminiClient(cmd.Cmd):
        open_color = ""
        close_color = ""
        for c in colors:
            if c in offthemes.colors:
                ansi = offthemes.colors[c]
            if c in themes.colors:
                ansi = themes.colors[c]
            else:
                ansi = ["32","39"]
            open_color += "%s;"%ansi[0]

M offpunk/__main__.py => offpunk/__main__.py +1 -1
@@ 1,3 1,3 @@
from . import main
from offpunk import main
main()


M offpunk/ansicat.py => offpunk/ansicat.py +3 -3
@@ 10,9 10,9 @@ import urllib
import argparse
import mimetypes
import fnmatch
from . import netcache, themes
from .utils import run,term_width,is_local,looks_like_base64
from .utils import _DATA_DIR
from offpunk import netcache, themes
from offpunk.utils import run,term_width,is_local,looks_like_base64
from offpunk.utils import _DATA_DIR
try:
    from readability import Document
    _HAS_READABILITY = True

M offpunk/netcache.py => offpunk/netcache.py +2 -2
@@ 13,8 13,8 @@ import datetime
import hashlib
import sqlite3
from ssl import CertificateError
from . import ansicat, utils
from .utils import _CACHE_PATH,_DATA_DIR,_CONFIG_DIR
from offpunk import ansicat, utils
from offpunk.utils import _CACHE_PATH,_DATA_DIR,_CONFIG_DIR
import time
try:
    import chardet

M offpunk/opnk.py => offpunk/opnk.py +2 -2
@@ 10,8 10,8 @@ import argparse
import shutil
import time
import fnmatch
from . import ansicat, netcache, utils
from .utils import run,term_width,mode_url,unmode_url,is_local
from offpunk import ansicat, netcache, utils
from offpunk.utils import run,term_width,mode_url,unmode_url,is_local

_HAS_XDGOPEN = shutil.which('xdg-open')
_GREP = "grep --color=auto"

M offpunk/utils.py => offpunk/utils.py +1 -1
@@ 13,7 13,7 @@ import shutil
import shlex
import urllib.parse
import urllib.parse
from . import cache_migration
from offpunk import cache_migration

CACHE_VERSION = 1