Example #1
0
 def wrap_description(self, description):
     _prefix = len('Short Description') + 2
     if cmdw.getWidth() < 112:
         width = cmdw.getWidth() - (_prefix + 2)
     else:
         width = int((cmdw.getWidth() / 2) - (_prefix + 2))
     prefix = " " * _prefix
     wrapped = textwrap.wrap(description, width=width)
     #debug(wrapped = wrapped)
     if len(wrapped) > 1:
         first_line = wrapped[0]
         print(make_colors(first_line, 'lightblue'))
         for i in wrapped[1:]:
             print(prefix + make_colors(i, 'lightcyan'))
     else:
         return make_colors(description, 'lightgreen')
Example #2
0
 def _print_center(self, strings, foreground, background=None):
     width = cmdw.getWidth()
     if len(strings) < width:
         _width = (width - len(strings)) / 2
         print((" " * (_width - 2)) +
               make_colors(strings, foreground, background))
     else:
         print(make_colors(strings, foreground, background))
Example #3
0
import sys
import requests
from bs4 import BeautifulSoup as bs
import argparse
import configset
import parserheader
import re
import codecs
import pm
import tarfile
import zipfile
import convert
from debug import debug
PID = os.getpid()
import cmdw
MAX_WIDTH = cmdw.getWidth()
TEST_COUNT = 0


class lfd(object):
    def __init__(self):
        super(lfd, self)
        self.URL = 'https://www.lfd.uci.edu/~gohlke/pythonlibs/'
        self.URL_DOWNLOAD = 'https://download.lfd.uci.edu/pythonlibs/'
        self.INDEX = "l8ulg3xw"
        self.CONFIG_NAME = 'lfd.ini'
        self.SESS = requests.Session()
        # self.PACKAGES = self.parser_content()
        self.pm = pm.pm

    def config(self, section, option, value=None, configname=None):
Example #4
0
 def __init__(self):
     super(clipmon, self)
     self.notify = notify()
     self.width = cmdw.getWidth()
     self.configname = os.path.join(os.path.dirname(__file__), 'clipmon.ini')
     self.config = configset(self.configname)
Example #5
0
import urlparse
import debug
import configset
debug.DEBUG = os.getenv('DEBUG')
debug.FILENAME = __file__
try:
    import __init__
    __version__ = __init__.__version__
    __test__ = __init__.__test__
    __build__ = __init__.__build__
    __platform__ = __init__.__platform__
    __email__ = __init__.__email__
except:
    pass
import cmdw
MAX = cmdw.getWidth()
MAX_TRY = 10

class autogeneratelink(object):

    def __init__(self, link=None, proxy = None):
        super(autogeneratelink, self)
        self.link = link
        self.url = 'http://www.autogeneratelink.us'
        self.proxy = proxy
        self.header = {}
        self.try_count = 0
        if vping.vping('autogeneratelink.com'):
            pass
        else:
            print make_colors("No Internet Connection !!!", 'yellow', attrs= ['blink'])
Example #6
0
#!/usr/bin/env python
#coding:utf-8
"""
  Author:  LICFACE --<*****@*****.**>
  Purpose: 
  Created: 7/19/2018
"""

import os
import sys
import win32service
from pprint import pprint
from debug import *
from make_colors import make_colors
import cmdw
MAX_LENGTH = cmdw.getWidth()
from texttable import Texttable
from textwrap import wrap


class ServiceList(object):
    def __init__(self):
        super(ServiceList, self)
        self.service_status = {
            1: 'STOPPED',
            2: 'START PENDING',
            3: 'STOP PENDING',
            4: 'RUNNING',
            6: 'PAUSE PENDING',
            7: 'PAUSED',
            16: 'START',
Example #7
0
        print "auth  =", auth
        url = url + '?auth={0}'.format(auth)
        print "list_uploadlink -> url:", url
        data = self.getURL1(url)
        return data

    def create_uploadlink(self,
                          folderid=0,
                          path='/',
                          comment='test 1',
                          expire='',
                          maxspace=0,
                          maxfiles=0):
        url = self.MASTER_URL + "createuploadlink"
        login = self.login()
        print "login ="******"auth  =", auth
        url = url + '?auth={0}&folderid={1}&path={2}&comment={3}&maxspace={4}&maxfiles={5}'.format(
            auth, folderid, path, comment, maxspace, maxfiles)
        print "create uploadlink -> url:", url
        data = self.getURL1(url)
        return data


if __name__ == '__main__':
    c = UploadLink()
    print c.create_uploadlink()
    print "-" * cmdw.getWidth()
    print c.list_uploadlink()