Esempio n. 1
0
                '    if argv == None:\n',
                '        argv = sys.argv\n',
                '\n',
                '    p = OptionParser()\n',
                '    # define options here\n',
                "    # p.add_option('-s', '--long',\n",
                "    #              action='', default='',\n",
                "    #              dest='', type='',\n",
                "    #              help='')\n",
                '    (o, a) = p.parse_args(argv)\n',
                '\n',
                '    # process arguments\n',
                '    for a in args:\n',
                '        process(a)\n',
                '\n',
                'class XyzzyTest(unittest.TestCase):\n',
                '    def test_example(self):\n',
                '        pass\n',
                '\n',
                'toolframe.ez_launch(main)\n',]

    return expected

# ---------------------------------------------------------------------------
def prepare_tests():
    global testdir
    testdir = testhelp.into_test_dir()

# ---------------------------------------------------------------------------
toolframe.tf_launch('pt', cleanup)
Esempio n. 2
0
            if o.attrib in el.attrib:
                # -- do the edit
#            tagl.append(el.tag)

 #       cp = os.path.commonprefix(tagl)
        # print cp

  #      for el in X.iter('%sservice' % cp):
            # print '---------------------------------'
            # print el.attrib
   #         attr = el.attrib
    #        if 'serviceType' in attr.keys() and attr['serviceType'] == 'SRM':
#                editable = el



        # print editable
        # print editable.attrib
        base = editable.attrib['base']
        # print base
        newbase = base.replace('esg2-sdnl1.ccs.ornl.gov', 'esg.ccs.ornl.gov')
        editable.attrib['base'] = newbase

        X.write(sys.stdout)

    pass
    

# ---------------------------------------------------------------------------
toolframe.tf_launch("xml")
Esempio n. 3
0
        """
        Test set_atime_to_mtime
        """
        filename = 'atom'
        open(filename, 'w').close()
        os.utime(filename, (time.time() - random.randint(1000, 2000),
                          time.time() + random.randint(1000, 2000)))
        s = os.stat(filename)
        assert(s[stat.ST_ATIME] != s[stat.ST_MTIME])
        fl_set_atime_to_mtime([filename])
        s = os.stat(filename)
        assert(s[stat.ST_ATIME] == s[stat.ST_MTIME])

    # -----------------------------------------------------------------------
    def test_mtoa(self):
        """
        Test set_mtime_to_atime
        """
        filename = 'mtoa'
        open(filename, 'w').close()
        os.utime(filename, (time.time() - random.randint(1000, 2000),
                          time.time() + random.randint(1000, 2000)))
        s = os.stat(filename)
        assert(s[stat.ST_ATIME] != s[stat.ST_MTIME])
        fl_set_mtime_to_atime([filename])
        s = os.stat(filename)
        assert(s[stat.ST_ATIME] == s[stat.ST_MTIME])

# ---------------------------------------------------------------------------
toolframe.tf_launch('fl')
Esempio n. 4
0
   provide a detailed description of what the function does.

Copyright (C) 1995 - <the end of time>  Tom Barron
  [email protected]
  177 Crossroads Blvd
  Oak Ridge, TN  37830

This software is licensed under the CC-GNU GPL. For the full text of
the license, see http://creativecommons.org/licenses/GPL/2.0/

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 2 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.
"""
import os
import pdb
import re
import sys
import toolframe

if os.path.exists("fabfile.py"):
    from fabfile import *

toolframe.tf_launch("fab")