Skip to content

Instantly share code, notes, and snippets.

Fredrik Averpil fredrikaverpil

Block or report user

Report or block fredrikaverpil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View decorator_wrapper.py
def _my_decorator(func):
def wrapper(*args, **kwargs):
print("wrapper got args...", args)
print("wrapper got kwargs...", kwargs)
print("Something is happening before the function is called.")
func(*args, **kwargs)
print("Something is happening after the function is called.")
return wrapper
@fredrikaverpil
fredrikaverpil / ftpupload.py
Created Feb 4, 2019
FTP upload with Python
View ftpupload.py
"""Upload file to folder.
Note:
Written for Python 3.7.
"""
import os
import ftplib
@fredrikaverpil
fredrikaverpil / powershell_tests.ps1
Last active Oct 1, 2018
PySide2 setup.py __file__ issues
View powershell_tests.ps1
# Get the repo, get the docker image
$ git clone -b 5.9 --recursive https://code.qt.io/pyside/pyside-setup.git pyside-setup-5.9
$ docker pull fredrikaverpil/pyside2-linux:centos7-qt5.9.4
# Execute pwd
$ docker run --rm --interactive --tty -v ${pwd}:/workdir fredrikaverpil/pyside2-linux:centos7-qt5.9.4 pwd
/workdir
# Just execute "ls" to show what's in the current directory
$ docker run --rm --interactive --tty -v ${pwd}:/workdir fredrikaverpil/pyside2-linux:centos7-qt5.9.4 ls
View create_document.py
import krita
def add_document_to_window():
"""Add new document to Krita
Arguments:
width (int): width in pixels
height (int): height in pixels
name (str): name of the image (not the filename of the document)
colorModel (str): color model of document, e.g. "RGBA", "XYZA", "LABA", "CMYKA", "GRAYA", "YCbCrA"
View qt-opensource-linux-x64-5.9.4.log
IFW Version: 3.0.2, built with Qt 5.9.0.
Build date: Dec 15 2017
Installer Framework SHA1: 8aa377c
[0] Language: C
[0] Arguments: /tmp/qt-installer.run, --script, /tmp/qt-installer-5.9.4-noninteractive.qs, -verbose
[2] Operations sanity check succeeded.
[2] Reading Qt Account settings from disk: "/root/.local/share/Qt/qtaccount.ini"
[2] Qt Account settings file [/root/.local/share/Qt/qtaccount.ini] does not exist.
[2] QtAccount information:
[2] Login completed: false
@fredrikaverpil
fredrikaverpil / common_members.json
Created Jan 23, 2018
Common members from Qt.py PR #268
View common_members.json
{
"QtCore": [
"QAbstractAnimation",
"QAbstractEventDispatcher",
"QAbstractItemModel",
"QAbstractListModel",
"QAbstractState",
"QAbstractTableModel",
"QAbstractTransition",
"QAnimationGroup",
View keybase.md

Keybase proof

I hereby claim:

  • I am fredrikaverpil on github.
  • I am fredrikaverpil (https://keybase.io/fredrikaverpil) on keybase.
  • I have a public key ASBgj6k_7yIkqfF9kUWtCgGLxkOntKTkNTdzHbuTLiXhdQo

To claim this, I am signing this object:

@fredrikaverpil
fredrikaverpil / run_membership_output.log
Last active Sep 22, 2017
Qt.py membership.py output log (verbose)
View run_membership_output.log
$ ./run_membership.sh
from PySide import QtCore
from PySide.QtCore import ClassInfo
from PySide.QtCore import LicensedDeclarative
from PySide.QtCore import LicensedMultimedia
from PySide.QtCore import LicensedOpenVG
from PySide.QtCore import MetaFunction
from PySide.QtCore import Property
from PySide.QtCore import QAbstractAnimation
View table.md
Header 1 Header 2 Header 3
And now for something completely different
And now for something completely different
And now for something completely different
And now for something completely different
And now for something completely different
And now for something completely different
And now for something completely different
You can’t perform that action at this time.