relative import back to offpunk

This commit is contained in:
Lionel Dricot 2023-09-16 10:53:15 +02:00
parent 963ac3d7a3
commit 8b97acc5e0
7 changed files with 18 additions and 15 deletions

3
offpunk.py Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env python3
from offpunk import main
main()

View File

@ -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]

View File

@ -1,3 +1,3 @@
from . import main
from offpunk import main
main()

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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