change imports for implementation into pype-start

This commit is contained in:
Jakub Trllo 2018-11-12 13:07:45 +01:00
parent aaacaf88c4
commit 50b015115c
4 changed files with 8 additions and 35 deletions

View file

@ -1,15 +0,0 @@
import credentials
import login_dialog
cred = credentials._get_credentials()
if 'username' in cred and 'apiKey' in cred:
validation = credentials._check_credentials(
cred['username'],
cred['apiKey']
)
if validation is False:
login_dialog.run_login()
else:
login_dialog.run_login()

View file

@ -1,10 +1,11 @@
import os
import toml
import ftrack_api
import appdirs
import appdirs
config_path = os.path.normpath(appdirs.user_data_dir('pype-app','pype'))
config_name = 'credentials.toml'
config_name = 'ftrack_cred.toml'
fpath = os.path.join(config_path, config_name)
def _get_credentials():

View file

@ -1,17 +1,10 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '..\CODE\github\pypeclub\pype-setup\temp\pype_project_settins_ui\login_dialogue.ui'
#
# Created by: PyQt5 UI code generator 5.7.1
#
# WARNING! All changes made in this file will be lost!
import sys
import requests
from PyQt5 import QtCore, QtGui, QtWidgets
from app import style
import credentials
import login_tools
import requests
from . import credentials, login_tools
class Login_Dialog_ui(QtWidgets.QWidget):
SIZE_W = 300

View file

@ -1,13 +1,7 @@
# :coding: utf-8
# :copyright: Copyright (c) 2016 ftrack
from http.server import BaseHTTPRequestHandler, HTTPServer
# import BaseHTTPServer
from urllib import parse
# import urlparse
import webbrowser
import functools
# from QtExt import QtCore
from PyQt5 import QtCore
# class LoginServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
@ -68,7 +62,7 @@ class LoginServerHandler(BaseHTTPRequestHandler):
self.end_headers()
self.wfile.write(message.encode())
if login_credentials:
self.login_callback(
api_user,