コード例 #1
0
ファイル: test_clean.py プロジェクト: wenjingk/scilifelab
    def setUp(self):
        super(CleanTest, self).setUp()
        ## Setup pre-casava results
        for k in self.RESULT_FILES.keys():
            for f in self.RESULT_FILES[k]:
                outfile = os.path.join(intermediate, flowcell, f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])
        for k in self.INPUT_FILES.keys():
            for f in self.INPUT_FILES[k]:
                outfile = os.path.join(data, flowcell,
                                       '1_120829_AA001AAAXX_barcode', f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])

        ## Setup casava results
        for k in self.RESULT_FILES.keys():
            for f in self.RESULT_FILES[k]:
                outfile = os.path.join(data, k, flowcell, f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])
        for k in self.INPUT_FILES.keys():
            for f in self.INPUT_FILES[k]:
                outfile = os.path.join(data, k, flowcell,
                                       '1_120829_AA001AAAXX_barcode', f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])
コード例 #2
0
ファイル: test_clean.py プロジェクト: hussius/scilifelab
    def setUp(self):
        super(CleanTest, self).setUp()
        ## Setup pre-casava results
        for k in self.RESULT_FILES.keys():
            for f in self.RESULT_FILES[k]:
                outfile = os.path.join(intermediate, flowcell, f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])
        for k in self.INPUT_FILES.keys():
            for f in self.INPUT_FILES[k]:
                outfile = os.path.join(data, flowcell, '1_120829_AA001AAAXX_barcode', f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])

        ## Setup casava results
        for k in self.RESULT_FILES.keys():
            for f in self.RESULT_FILES[k]:
                outfile = os.path.join(data, k, flowcell, f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])
        for k in self.INPUT_FILES.keys():
            for f in self.INPUT_FILES[k]:
                outfile = os.path.join(data, k, flowcell, '1_120829_AA001AAAXX_barcode', f)
                if not os.path.exists(os.path.dirname(outfile)):
                    safe_makedir(os.path.dirname(outfile))
                exit_code = shell.exec_cmd2(['touch', outfile])
コード例 #3
0
ファイル: base.py プロジェクト: derks/boss
 def sync(self, source):
     sources = self.app.db['sources']
     src = self.app.db['sources'][source]
     if not src['is_local']:
         if not os.path.exists(os.path.join(src['cache'], '.git')):
             shell.exec_cmd2([ 'git', 'clone', 
                             src['path'], src['cache'] ])
         else:
             os.chdir(src['cache'])
             shell.exec_cmd2(['git', 'pull'])
     src['last_sync_time'] = datetime.now()
     sources[source] = src
     self.app.db['sources'] = sources
コード例 #4
0
ファイル: AFTBackup.py プロジェクト: antonqiu/AFT
 def unpack(self):
     cmd = ['java', '-jar', 'lib/abe.jar', 'unpack', self.options.in_backup[0], self.options.out_archive[0]]
     exitcode = shell.exec_cmd2(cmd)
     self.log.debug('abe exit: %d.' % exitcode, __name__)
     if exitcode == 0:
         # self.log.info('Done.')
         # self.log.info('tar archive is saved as: %s' % self.options.out_archive[0])
         CoreUtil.hash(self.options.out_archive[0])
     else:
         self.log.warning('Backup Unpack module exit unexpectedly: %d.' % exitcode)
コード例 #5
0
    def sync(self, source):
        sources = self.app.db['sources']
        src = self.app.db['sources'][source]

        if not src['is_local']:
            if not os.path.exists(os.path.join(src['cache'], '.git')):
                shell.exec_cmd2(['git', 'clone', src['path'], src['cache']])
            else:
                orig_dir = fs.abspath(os.curdir)
                try:
                    os.chdir(src['cache'])
                    shell.exec_cmd2(['git', 'pull'])
                    os.chdir(orig_dir)
                finally:
                    os.chdir(orig_dir)

        src['last_sync_time'] = datetime.now()
        sources[source] = src
        self.app.db['sources'] = sources
コード例 #6
0
ファイル: source.py プロジェクト: ColinDuquesnoy/boss
    def sync(self, source):
        sources = self.app.db["sources"]
        src = self.app.db["sources"][source]

        if not src["is_local"]:
            if not os.path.exists(os.path.join(src["cache"], ".git")):
                shell.exec_cmd2(["git", "clone", src["path"], src["cache"]])
            else:
                orig_dir = fs.abspath(os.curdir)
                try:
                    os.chdir(src["cache"])
                    shell.exec_cmd2(["git", "pull"])
                    os.chdir(orig_dir)
                finally:
                    os.chdir(orig_dir)

        src["last_sync_time"] = datetime.now()
        sources[source] = src
        self.app.db["sources"] = sources
コード例 #7
0
 def _do_tests(self):
     print('Running Nose Tests')
     out, err, res = shell.exec_cmd(['which', 'nosetests'])
     nose = out.decode('utf-8').strip()
     if self.app.pargs.loud:
         cmd_args = ['coverage', 'run', nose, '--verbosity=3']
         res = shell.exec_cmd2(cmd_args)
     else:
         cmd_args = ['coverage', 'run', nose, '--verbosity=0']
         out, err, res = shell.exec_cmd(cmd_args)
     if res > 0:
         self._do_error("\n\nNose tests did not pass.\n\n" +
                        "$ %s\n%s" % (' '.join(cmd_args), err))
コード例 #8
0
ファイル: devtools.py プロジェクト: Ankur2212/cement
 def _do_tests(self):
     print('Running Nose Tests')
     out, err, res = shell.exec_cmd(['which', 'nosetests'])
     
     if self.app.pargs.loud:
         cmd_args = ['coverage', 'run', out.strip(), '--verbosity=3']
         res = shell.exec_cmd2(cmd_args)
     else:
         cmd_args = ['coverage', 'run', out.strip(), '--verbosity=0']
         out, err, res = shell.exec_cmd(cmd_args)
     if res > 0:
         self._do_error("\n\nNose tests did not pass.\n\n" +
                        "$ %s\n%s" % (' '.join(cmd_args), err))
コード例 #9
0
ファイル: test_project.py プロジェクト: Galithil/scilifelab
 def setUp(self):
     super(ProjectTest, self).setUp()
     ## FIX ME: deliver data first - serves as test data
     self.app = self.make_app(argv = [])
     self.app.setup()
     self.fastq_dir = os.path.join(self.app.config.get("project", "root"), "j_doe_00_01", "data", flowcell)
     safe_makedir(self.fastq_dir)
     for f in self.COMPRESS_FILES:
         m = glob.glob("{}*".format(os.path.join(self.fastq_dir, f)))
         if not m:
             exit_code = shell.exec_cmd2(['touch', os.path.join(self.fastq_dir, f)])
     flist = walk(j_doe_00_04['data'])
     for f in flist:
         os.unlink(f)
コード例 #10
0
 def setUp(self):
     super(ProjectTest, self).setUp()
     ## FIX ME: deliver data first - serves as test data
     self.app = self.make_app(argv=[])
     self.app.setup()
     self.fastq_dir = os.path.join(self.app.config.get("project", "root"),
                                   "j_doe_00_01", "data", flowcell)
     safe_makedir(self.fastq_dir)
     for f in self.COMPRESS_FILES:
         m = glob.glob("{}*".format(os.path.join(self.fastq_dir, f)))
         if not m:
             exit_code = shell.exec_cmd2(
                 ['touch', os.path.join(self.fastq_dir, f)])
     flist = walk(j_doe_00_04['data'])
     for f in flist:
         os.unlink(f)
コード例 #11
0
ファイル: AFTBackup.py プロジェクト: antonqiu/AFT
 def execute(self):
     cmd = ['adb', 'backup']
     if self.options.apk:
         cmd.append('-apk')
     if self.options.all:
         cmd.append('-all')
     if self.options.system:
         cmd.append('-system')
     if self.options.obb:
         cmd.append('-obb')
     if self.options.shared:
         cmd.append('-shared')
     if self.options.filename:
         cmd.append('-f %s' % self.options.filename)
     exitcode = shell.exec_cmd2(cmd)
     self.log.debug('adb backup exit: %d.' % exitcode, __name__)
     if exitcode == 0:
         # self.log.info('Done.')
         # self.log.info('Backup is saved as: %s' % self.options.filename)
         CoreUtil.hash(self.options.filename)
     else:
         self.log.warning('Logical Acquisition module exit unexpectedly: %d.' % exitcode)
コード例 #12
0
 def list(self):
     cmd = ['adb', 'shell', 'pm', 'list', 'packages', '-u', '-f']
     shell.exec_cmd2(cmd)
コード例 #13
0
ファイル: shell_tests.py プロジェクト: mapmyfitness/cement
 def test_exec_cmd2_bad_command(self):
     ret = shell.exec_cmd2(['false'])
     self.eq(ret, 1)
コード例 #14
0
ファイル: shell_tests.py プロジェクト: mapmyfitness/cement
 def test_exec_cmd2_shell_true(self):
     ret = shell.exec_cmd2(['echo johnny'], shell=True)
     self.eq(ret, 0)
コード例 #15
0
ファイル: shell_tests.py プロジェクト: mapmyfitness/cement
 def test_exec_cmd2(self):
     ret = shell.exec_cmd2(['echo'])
     self.eq(ret, 0)
コード例 #16
0
ファイル: test_shell.py プロジェクト: vagnerdev/cement
def test_exec_cmd2_bad_command():
    ret = shell.exec_cmd2(['false'])
    assert ret == 1
コード例 #17
0
ファイル: test_shell.py プロジェクト: vagnerdev/cement
def test_exec_cmd2_shell_true():
    ret = shell.exec_cmd2(['echo johnny'], shell=True)
    assert ret == 0
コード例 #18
0
ファイル: test_shell.py プロジェクト: vagnerdev/cement
def test_exec_cmd2():
    ret = shell.exec_cmd2(['echo'])
    assert ret == 0
コード例 #19
0
ファイル: test_shell.py プロジェクト: datafolklabs/cement
def test_exec_cmd2():
    ret = shell.exec_cmd2(['echo'])
    assert ret == 0
コード例 #20
0
ファイル: test_shell.py プロジェクト: datafolklabs/cement
def test_exec_cmd2_shell_true():
    ret = shell.exec_cmd2(['echo johnny'], shell=True)
    assert ret == 0
コード例 #21
0
ファイル: test_shell.py プロジェクト: datafolklabs/cement
def test_exec_cmd2_bad_command():
    ret = shell.exec_cmd2(['false'])
    assert ret == 1