Exemplo n.º 1
0
 def __init__(self):
     self.log = Log.get_logger('MicroPy')
     self.verbose = True
     self.log.debug("MicroPy Loaded")
     if not data.STUB_DIR.exists():
         self.setup()
Exemplo n.º 2
0
# -*- coding: utf-8 -*-
"""Various requirement checks for templates."""

import subprocess as subproc
from functools import partial as _p

from micropy.logger import Log
from packaging import version

VSCODE_MS_PY_MINVER = "2019.9.34474"

log = Log.get_logger("MicroPy")


def iter_vscode_ext(name=None):
    """Iterates over installed VSCode Extensions.

    Args:
        name (str, optional): Name of Extension to Yield

    """
    _cmd = "code --list-extensions --show-versions"
    proc = subproc.run(_cmd,
                       stdout=subproc.PIPE,
                       stderr=subproc.PIPE,
                       shell=True)
    results = [e.strip() for e in proc.stdout.splitlines()]
    for ext in results:
        ename, vers = ext.split("@")
        if not name:
            yield (ename, vers)
Exemplo n.º 3
0
 def __init__(self):
     self.log = Log.get_logger('MicroPy')
     self.setup()
Exemplo n.º 4
0
# -*- coding: utf-8 -*-

"""Various requirement checks for templates."""

import subprocess as subproc
from functools import partial as _p

from packaging import version

from micropy.logger import Log

VSCODE_MS_PY_MINVER = "2019.9.34474"

log = Log.get_logger('MicroPy')


def iter_vscode_ext(name=None):
    """Iterates over installed VSCode Extensions.

    Args:
        name (str, optional): Name of Extension to Yield

    """
    _cmd = "code --list-extensions --show-versions"
    proc = subproc.run(_cmd, stdout=subproc.PIPE, stderr=subproc.PIPE, shell=True)
    results = [e.strip() for e in proc.stdout.splitlines()]
    for ext in results:
        ename, vers = ext.split('@')
        if not name:
            yield (ename, vers)
        if name and ename == name: