Add files via upload
This commit is contained in:
parent
b5a966f2d8
commit
29e06e6e18
1 changed files with 21 additions and 10 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
from krita import *
|
||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
|
@ -24,31 +25,40 @@ class MyHTMLParser(HTMLParser):
|
||||||
# define object/class for analysis
|
# define object/class for analysis
|
||||||
class textforart:
|
class textforart:
|
||||||
|
|
||||||
def __init__(self, language, sentences_lens, sentences, commas, polarity):
|
def __init__(self, language, sentence_lens, sentences, commas, polarity):
|
||||||
# Sprache
|
# Sprache
|
||||||
self.language = language
|
self.language = language
|
||||||
|
|
||||||
# Satz
|
# Satz
|
||||||
|
if len(sentences) == 0:
|
||||||
|
sentences = ['Hello fellow human beeing ^.^']
|
||||||
self.senctences = sentences
|
self.senctences = sentences
|
||||||
|
|
||||||
# Sentence lengthes
|
# Sentence lengthes
|
||||||
self.sentences_lens = sentence_lens
|
if len(sentence_lens) == 0:
|
||||||
|
sentence_lens = [0]
|
||||||
|
self.sentence_lens = sentence_lens
|
||||||
|
|
||||||
# Commas
|
# Commas
|
||||||
|
if len(commas) == 0:
|
||||||
|
commas = [0]
|
||||||
self.commas = commas
|
self.commas = commas
|
||||||
|
|
||||||
# Bewertung
|
# Bewertung
|
||||||
|
if len(polarity) == 0:
|
||||||
|
polarity = [0]
|
||||||
self.polarity = polarity
|
self.polarity = polarity
|
||||||
|
|
||||||
# Komplezität
|
# Komplezität
|
||||||
|
complexity = [0]
|
||||||
self.complexity = ''
|
self.complexity = ''
|
||||||
|
|
||||||
|
|
||||||
# Satzlänge
|
# Satzlänge
|
||||||
self.sentence_number = len(sentences)
|
self.sentence_number = len(sentences)
|
||||||
self.min_sentence_length = min(sentences_lens)
|
self.min_sentence_length = min(sentence_lens)
|
||||||
self.max_sentence_length = max(sentences_lens)
|
self.max_sentence_length = max(sentence_lens)
|
||||||
self.mean_sentence_length = sum(sentences_lens) / len(sentences)
|
self.mean_sentence_length = sum(sentence_lens) / len(sentences)
|
||||||
|
|
||||||
# Kommas
|
# Kommas
|
||||||
self.number_commas = len(commas)
|
self.number_commas = len(commas)
|
||||||
|
@ -71,6 +81,7 @@ class textforart:
|
||||||
self.signatur_word = ''
|
self.signatur_word = ''
|
||||||
|
|
||||||
def add_svg(svg):
|
def add_svg(svg):
|
||||||
|
|
||||||
clipboard = QGuiApplication.clipboard()
|
clipboard = QGuiApplication.clipboard()
|
||||||
mime_data = QMimeData()
|
mime_data = QMimeData()
|
||||||
mime_data.setData('image/svg+xml', svg)
|
mime_data.setData('image/svg+xml', svg)
|
||||||
|
@ -80,13 +91,13 @@ def add_svg(svg):
|
||||||
def create_svg(svg):
|
def create_svg(svg):
|
||||||
app = Krita.instance()
|
app = Krita.instance()
|
||||||
# Document open?
|
# Document open?
|
||||||
#if app.activeDocument():
|
if app.activeDocument():
|
||||||
#print("aktive document")
|
#print("aktive document")
|
||||||
#doc = app.activeDocument()
|
doc = app.activeDocument()
|
||||||
#else:
|
else:
|
||||||
#print("create document")
|
#print("create document")
|
||||||
#doc = app.createDocument(800, 600, 'SVGA Test', 'RGBA', 'U8', '', 120.0)
|
doc = app.createDocument(800, 600, 'SVGA Test', 'RGBA', 'U8', '', 120.0)
|
||||||
#app.activeWindow().addView(doc)
|
app.activeWindow().addView(doc)
|
||||||
|
|
||||||
doc = app.createDocument(800, 600, 'SVGA Test', 'RGBA', 'U8', '', 120.0)
|
doc = app.createDocument(800, 600, 'SVGA Test', 'RGBA', 'U8', '', 120.0)
|
||||||
app.activeWindow().addView(doc)
|
app.activeWindow().addView(doc)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue