Sfoglia il codice sorgente

Made script work with both 2.7 and 3

master
Teknikode 2 anni fa
parent
commit
852ab65f5c
2 ha cambiato i file con 20 aggiunte e 11 eliminazioni
  1. 4
    2
      Hexchat/README.md
  2. 16
    9
      Hexchat/teknik.py

+ 4
- 2
Hexchat/README.md Vedi File

@@ -2,7 +2,7 @@

### Installation

* Make sure Hexchat is installed with the Python 3 plugin
* Make sure Hexchat is installed with the Python plugin (both 2 and 3 supported)
* Install the [teknik](https://git.teknik.io/Teknikode/Teknik-Python) module
* `pip install teknik`
* Copy the scripts to the 'addon' folder for Hexchat
@@ -10,4 +10,6 @@

### Usage

To use it, simply type `/teknik` which will bring up a file dialog prompt. Select the file you want to upload, and then once it's done, the generated link will be put into the input box of hexchat.
To use it, simply type `/teknik upload` which will bring up a file dialog prompt. Select the file you want to upload, and then once it's done, the generated link will be put into the input box of hexchat.

You can also manually specify the file to upload as an argument, and set addon configuration settings.

+ 16
- 9
Hexchat/teknik.py Vedi File

@@ -4,22 +4,29 @@ __module_description__ = "Interact with the Teknik Services, including file uplo

import_success = True

import tkinter as tk
from tkinter.filedialog import askopenfilename
try:
import Tkinter as tk
except ImportError:
import tkinter as tk

try:
from tkinter.filedialog import askopenfilename
except ImportError:
from tkFileDialog import askopenfilename

try:
import hexchat
import hexchat
except ImportError:
print('This script must be run under Hexchat.')
print('Get Hexchat now at: https://hexchat.github.io/')
import_ok = False
print('This script must be run under Hexchat.')
print('Get Hexchat now at: https://hexchat.github.io/')
import_success = False

# Requires Install
try:
from teknik import uploads as teknik
from teknik import uploads as teknik
except ImportError as e:
print('Missing package(s) for %s: %s' % (__module_name__, e))
import_ok = False
print('Missing package(s) for %s: %s' % (__module_name__, e))
import_success = False

def teknik_prompt():
# Prompt for a file

Loading…
Annulla
Salva