This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, requests, shutil | |
try: | |
import sh | |
except: | |
pass | |
from fenx.tools.process_output import logger, steps | |
from fenx.tools.utils import sudo, download_file, OS, copytree, move_tree, is_admin | |
requests.packages.urllib3.disable_warnings() | |
from fenx.tools import qt_cmd, utils | |
# PY_VERSION = 20168704 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, ctypes | |
def is_admin(): | |
if os.name == 'nt': | |
return ctypes.windll.shell32.IsUserAnAdmin() != 0 | |
else: | |
return os.geteuid() == 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide.QtCore import * | |
from PySide.QtGui import * | |
import sys | |
regionColor = QColor(200,200,200) | |
textColor = QColor(0,0,0) | |
bgColor = QColor(200,200,200) | |
class captureRegionClass(QWidget): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class steps(object): | |
def __init__(self, array, start_end, callback, modulo=None): | |
""" | |
Sper constructor | |
:param array: list (for iterator) or int (for context manager) | |
:param start_end: start output percentage | |
:param callback: end output percentage | |
:param modulo: round output | |
""" | |
self.callback = callback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket, json | |
from httplib import HTTPResponse | |
def get_port(): | |
# some function | |
return 57980 | |
def request(path, **kwargs): | |
HOST = 'localhost' | |
PORT = get_port() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
import maya.mel as mel | |
# ends positions | |
p1 = [0,0,0] | |
p2 = [0.0, 10.0, 0.0] | |
#create curve | |
curvePos = [] | |
for i in range(6): | |
x = p1[0] + (((p2[0] - p1[0]) / 5.0)*i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymel.core import * | |
# original setup | |
SCENE.defaultRenderGlobals.imageFilePrefix.set('/render_output/frame_<RenderLayer>') | |
SCENE.defaultRenderGlobals.animation.set(1) | |
SCENE.defaultRenderGlobals.outFormatControl.set(2) | |
SCENE.defaultRenderGlobals.putFrameBeforeExt.set(1) | |
SCENE.defaultRenderGlobals.extensionPadding.set(3) | |
# get path and add format expression |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bot_config import * | |
import requests | |
import logging | |
logger = logging.getLogger(__name__) | |
url = 'https://api.telegram.org/bot{}/{}' | |
def _send_text(text, c_id=None, parse_mode='Markdown'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide.QtCore import * | |
import sys, os, tempfile, json, random, hashlib, shlex, shutil | |
import logging as _logging | |
logger = _logging.getLogger(__name__) | |
logger.setLevel(_logging.DEBUG) | |
class ProcessControl(QObject): | |
""" | |
Thos class control process queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This class allow you call function in thread and receive many signals about progress | |
""" | |
from PySide.QtCore import * | |
import time, hashlib, random | |
import logging as _logging | |
logger = _logging.getLogger(__name__) | |
class ThreadControl(QObject): |