예제 #1
0
파일: gittools.py 프로젝트: ourway/Vixen
 def __init__(self, *args, **kw):
     '''constructor'''
     self.vixenpath = config.getpath(storage=None)
     self.storagepath = config.getpath()
     sep = os.path.sep
     Vdata.__init__(self, self.storagepath)
     self.gitexe = 'git'
     if os.name == 'nt':  # for windoows users
         self.gitexe = '%s%sutils%sWGit%sbin%sgit' % (self.vixenpath, sep, sep, sep, sep)
     self.filelist = set()  # all files that we will add to git.
예제 #2
0
 def __init__(self, *args, **kw):
     '''constructor'''
     self.vixenpath = config.getpath(storage=None)
     self.storagepath = config.getpath()
     sep = os.path.sep
     Vdata.__init__(self, self.storagepath)
     self.gitexe = 'git'
     if os.name == 'nt':  # for windoows users
         self.gitexe = '%s%sutils%sWGit%sbin%sgit' % (self.vixenpath, sep,
                                                      sep, sep, sep)
     self.filelist = set()  # all files that we will add to git.
예제 #3
0
 def __init__(self, filename=None):
     if filename:
         self._in_memory = False
         self._store = anydbm.open(config.getpath(filename), 'c')
     else:
         self._in_memory = True
         self._store = {}
예제 #4
0
파일: license.py 프로젝트: jonike/Vixen
    def chkLicense(self):
        #print linGen(getHostId())
        #self.evo() #prepareations
        sep = os.path.sep
        licPath = '%s%slicense%svishka.lic' % (config.getpath(), sep, sep)
        self.lic = False
        if os.path.isfile(licPath):  # license file is available
            ldatalines = open(licPath, 'r').readlines()  # read first line of code
            if ldatalines:
                ldata = ldatalines[0]
                if ldata == self.linGen(self.getHostId()):  # Check License file
                    self.lic = True
                    return self.lic
        else:  # lic file is not available
            rem = self.doEvo()
            #print rem
            if rem:
                self.lic = True
                print('Vixen: You are in non-commercial mode.')
                return self.lic

        if not self.lic:
            warning('Vishka License is not available. Your HostID is: [%s]. visit: www.VISHKA.com/Vixen for more information.' % self.getHostId())
            #return False
            sys.exit()  # finish program.
예제 #5
0
############ Run File Data Extraction and Aggregation ###########

import glob
import os
import sys

sys.path.append("../../common/")  ## to analysis/
import config as cf  ## some basic shit that I don't want to do myself

# cf.addpath( "integrity_testing/" )
# import integrity_testing as it


plot_from_csv_path = cf.getpath("graph_generation/plot_from_csv.py")
bar_chart_from_csv_path = cf.getpath("graph_generation/bar_chart_from_csv.py")


def plot_timeseries(
    infiles_glob,
    outfile,
    grouping="",
    subgrouping="",
    legend=False,
    datasources=None,
    title="",
    xlabel="",
    ylabel="",
    ploterror=False,
    xtickinterval=None,
    type="median_only",
):
예제 #6
0
############ Run File Data Extraction and Aggregation ###########

import glob
import os
import sys

sys.path.append("../../common/") ## to analysis/
import config as cf## some basic shit that I don't want to do myself

#cf.addpath( "integrity_testing/" )
#import integrity_testing as it


plot_from_csv_path = cf.getpath("graph_generation/plot_from_csv.py")
bar_chart_from_csv_path = cf.getpath("graph_generation/bar_chart_from_csv.py")

def plot_timeseries( infiles_glob, outfile, 
    grouping="", 
    subgrouping="", 
    legend=False,
    datasources=None,
    title="",
    xlabel="",
    ylabel="",
    ploterror=False,
    xtickinterval=None,
    type="median_only" ):

    ## manage the inputs
    
    if grouping:
############ Run File Data Extraction and Aggregation ###########

import glob
import os
import sys
sys.path.append("../../common/") ## to analysis/
import config as cf## some basic shit that I don't want to do myself

cf.addpath( "integrity_testing/" )
import integrity_testing as it

extract_single_column_to_csv_path = cf.getpath( "common/extract_single_column_to_csv.py" )
aggregate_file_path = cf.getpath( "common/aggregate_file.py" )

def aggregate_timeseries( directories, input_files_glob, outfile, column, grouping="", subgrouping="", verbose=False, separator=" ", header=False, test=False, expected=None ):

    cwd = cf.Config.Script.cwd

    if grouping:
        grouping = "%s_" % grouping
    if subgrouping:
        subgrouping = "%s__" % subgrouping

    headeropt = ""
    if header:
        headeropt = "--header"


    aggregate_filename = os.path.join( cwd, "%s%s%s.timeseries.csv" % (grouping, subgrouping, outfile) )
    
    if test: