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 time
import urllib.parse import urllib.parse
import subprocess import subprocess
from . import ansicat, netcache, opnk, themes from offpunk import ansicat, netcache, opnk, themes
from .utils import run,term_width,is_local,mode_url,unmode_url from offpunk.utils import run,term_width,is_local,mode_url,unmode_url
from .utils import _CONFIG_DIR,_DATA_DIR,_CACHE_PATH from offpunk.utils import _CONFIG_DIR,_DATA_DIR,_CACHE_PATH
try: try:
import setproctitle import setproctitle
setproctitle.setproctitle("offpunk") setproctitle.setproctitle("offpunk")
@ -138,7 +138,7 @@ class GeminiClient(cmd.Cmd):
# type sensitivie information. # type sensitivie information.
os.umask(0o077) os.umask(0o077)
self.opencache = opnk.opencache() self.opencache = opnk.opencache()
self.theme = offthemes.default self.theme = themes.default
self.prompt = self.set_prompt("ON") self.prompt = self.set_prompt("ON")
self.current_url = None self.current_url = None
self.hist_index = 0 self.hist_index = 0
@ -205,8 +205,8 @@ class GeminiClient(cmd.Cmd):
open_color = "" open_color = ""
close_color = "" close_color = ""
for c in colors: for c in colors:
if c in offthemes.colors: if c in themes.colors:
ansi = offthemes.colors[c] ansi = themes.colors[c]
else: else:
ansi = ["32","39"] ansi = ["32","39"]
open_color += "%s;"%ansi[0] open_color += "%s;"%ansi[0]

View File

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

View File

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

View File

@ -13,8 +13,8 @@ import datetime
import hashlib import hashlib
import sqlite3 import sqlite3
from ssl import CertificateError from ssl import CertificateError
from . import ansicat, utils from offpunk import ansicat, utils
from .utils import _CACHE_PATH,_DATA_DIR,_CONFIG_DIR from offpunk.utils import _CACHE_PATH,_DATA_DIR,_CONFIG_DIR
import time import time
try: try:
import chardet import chardet

View File

@ -10,8 +10,8 @@ import argparse
import shutil import shutil
import time import time
import fnmatch import fnmatch
from . import ansicat, netcache, utils from offpunk import ansicat, netcache, utils
from .utils import run,term_width,mode_url,unmode_url,is_local from offpunk.utils import run,term_width,mode_url,unmode_url,is_local
_HAS_XDGOPEN = shutil.which('xdg-open') _HAS_XDGOPEN = shutil.which('xdg-open')
_GREP = "grep --color=auto" _GREP = "grep --color=auto"

View File

@ -13,7 +13,7 @@ import shutil
import shlex import shlex
import urllib.parse import urllib.parse
import urllib.parse import urllib.parse
from . import cache_migration from offpunk import cache_migration
CACHE_VERSION = 1 CACHE_VERSION = 1