Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Set default charset
[*.{js,py,rst,json,yml,html,txt}]
charset = utf-8

[*.{py}]
indent_style = space
indent_size = 4

[*.{html,js,rst,scss}]
indent_style = tab
indent_size = 4

[*.{json,yml,css}]
indent_style = space
indent_size = 2
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# pyCharm
.idea/
venv/
venv_python27/

#python
*.pyc
*.pyo

629 changes: 9 additions & 620 deletions LICENSE

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions bin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from gettext import gettext as _
from datetime import datetime

from findenv import osenv
from version import version
__version__ = '1.0a'
ABOUTPROGRAM = _("Kleiner Helfer für den Telefonsupport")
ABOUTTXT = _(f"""
Mit dem Support-Client kann man einfach bei einem Telefonsupport die Anweisungen folgen und z.B.: die Fernwartung starten.
Ohne dabei mit dem Browser on sonst irgendeinem Tool nach dem Fernwartungsprogramm zu suchen und Herunterladen versuchen.

MIT @ {datetime.now().year} Bailey Solution""")
PROGRAM_NAME = "Support Client"
47 changes: 11 additions & 36 deletions bin/findenv.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################################################################################################
# Support-Client <http://wiki.pratznschutz.com/index.php/Support-Client>. #
# Copyright (C) [2015] [Guenter Bailey] #
# #
# This program is free software; #
# you can redistribute it and/or modify it under the terms of the GNU General Public License #
# as published by the Free Software Foundation; #
# either version 3 of the License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# See the GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License along with this program; #
# if not, see <http://www.gnu.org/licenses/>. #
##############################################################################################################################
from sys import platform as _platform
import platform


class osenv(object):
def __init__(self):
self.text="Text"

def __new__(self):
env=()
if _platform == "linux" or _platform == "linux2":
env=("linux")
elif _platform == "darwin" or _platform == "mac":
env=("macos")
elif _platform == "win32" or _platform == "win64":
env=("nt")
elif _platform == "nt" or _platform == "win":
env=("nt")
else:
env=("linux")
return (env)
def get_osname():
env = 'linux'
if platform.system():
if platform.system().lower() in ['linux', 'linux2']:
env = 'linux'
elif platform.system().lower() in ['mac', 'darwin']:
env = 'mac'
elif platform.system().lower() in ['win32', 'win64', 'windows', 'win', 'nt']:
env = 'nt'
return env
15 changes: 15 additions & 0 deletions bin/license.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
information = """
Copyright 2020 Günter Bailey

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

"""
75 changes: 37 additions & 38 deletions bin/update.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,16 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################################################################################################
# Support-Client <http://wiki.pratznschutz.com/index.php/Support-Client>. #
# Copyright (C) [2015] [Guenter Bailey] #
# #
# This program is free software; #
# you can redistribute it and/or modify it under the terms of the GNU General Public License #
# as published by the Free Software Foundation; #
# either version 3 of the License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# See the GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License along with this program; #
# if not, see <http://www.gnu.org/licenses/>. #
##############################################################################################################################
import os,zipfile,shutil
import os
import zipfile
import shutil
from os import curdir,sep
from tkMessageBox import showinfo,showerror
from bin import osenv as _osenv
from lang import de_DE, en_EN
from conf import setlang
from conf import check as _check
from tkinter.messagebox import showinfo, showerror
from .findenv import get_osname as _osenv
from gettext import gettext as _
from subprocess import Popen, PIPE

support_cldir = "support-client"

ltrans = ()
if setlang.langn == "de_DE":
ltrans = de_DE()
elif setlang.langn == "en_EN":
ltrans = en_EN()
else:
ltrans = de_DE()

def chk_connection():
pingopt = ''
Expand All @@ -52,6 +30,7 @@ def chk_connection():
stat = "Error"
return stat


def forceMergeFlatDir(srcDir, dstDir):
if not os.path.exists(dstDir):
os.makedirs(dstDir)
Expand All @@ -60,17 +39,20 @@ def forceMergeFlatDir(srcDir, dstDir):
dstFile = os.path.join(dstDir, item)
forceCopyFile(srcFile, dstFile)


def forceCopyFile (sfile, dfile):
if os.path.isfile(sfile):
shutil.copy2(sfile, dfile)


def isAFlatDir(sDir):
for item in os.listdir(sDir):
sItem = os.path.join(sDir, item)
if os.path.isdir(sItem):
return False
return True


def copyTree(src, dst):
for item in os.listdir(src):
s = os.path.join(src, item)
Expand All @@ -86,18 +68,21 @@ def copyTree(src, dst):
else:
forceMergeFlatDir(s, d)


def msdelupdate(srcDir):
try:
os.system("rmdir /s /q "+srcDir+sep)
except:
print("fehler bei update delete")


def mscopy(srcDir, dstDir):
try:
os.system("xcopy "+srcDir+sep+"*"+" "+dstDir+" /Y /E")
except IOError:
print("xcopy fehler")


def extract(fpath, fname):
ext = (fpath+sep+fname)
try:
Expand All @@ -115,16 +100,12 @@ def extract(fpath, fname):


class start_updater():
def __init__(self):
if _osenv() == "nt":
updname = "scupdate_win.zip"
else:
updname = "scupdate_linux.zip"

self.url = ("http://download.bailey-solution.com/Support-Client/"+updname)
self.dldir = (curdir+sep+"temp"+sep+"update")
def __init__(self, config):
self.cfg = config
self.url = f"{config['remote_app']['server']}/{config['remote_app'][_osenv()]}"
self.dldir = f"{config['tmpdir']}{sep}update"
self.fname = self.url.split('/')[-1]
if chk_connection() == "OK":
if self.check_connection():
try:
self.dlprogram()
extract(self.dldir, self.fname)
Expand All @@ -134,8 +115,26 @@ def __init__(self):
else:
showerror(ltrans.programm_name, ltrans.label_update_error)

def check_connection(self):
cmd = ['ping']
if _osenv() == "nt":
cmd.append('-n')
elif _osenv() in ["linux", "macos"]:
cmd.append('-c')
else:
cmd.append('-c')
cmd.append(self.cfg['test']['ping']['repeat'])
cmd.append(self.cfg['test']['ping']['server'])
p1, error = Popen(cmd, stdout=PIPE)
if not error:
return True
else:
return False

def dlprogram(self):
import urllib
import urllib2

if not os.path.exists(self.dldir):
os.makedirs(self.dldir)

Expand Down
21 changes: 0 additions & 21 deletions bin/version.py

This file was deleted.

4 changes: 0 additions & 4 deletions conf/__init__.py

This file was deleted.

44 changes: 0 additions & 44 deletions conf/config.py

This file was deleted.

4 changes: 0 additions & 4 deletions lang/__init__.py

This file was deleted.

Loading