Did I find the right examples for you? yes no

All Samples(20)  |  Call(14)  |  Derive(0)  |  Import(6)
Usage:
  -n, --num-items=[val]  set the number of items to download (per feed)
  -c, --config=[file]    load config from file (must be in yaml format)
  -d, --no-download      don't download new items, just tell google reader about read items
  -t, --test             run in test mode (don't notify google reader of anything)
  -c, --cautious         cautious mode - prompt before performing destructive actions
  -o, --output-path=[p]  set the base output path (where items and resources are saved)
  --tag-list-only        just get the current list of tags and exit
  --newest-first         get newest items first instead of oldest
  --user=[username]      set the username(more...)

        def parse_options(argv = None):
	"""
Usage:
  -n, --num-items=[val]  set the number of items to download (per feed)
  -c, --config=[file]    load config from file (must be in yaml format)
  -d, --no-download      don't download new items, just tell google reader about read items
  -t, --test             run in test mode (don't notify google reader of anything)
  -c, --cautious         cautious mode - prompt before performing destructive actions
  -o, --output-path=[p]  set the base output path (where items and resources are saved)
  --tag-list-only        just get the current list of tags and exit
  --newest-first         get newest items first instead of oldest
  --user=[username]      set the username
  --password=[pass]      set password
  --tag=[tag_name]       add a tag to the list of tags to be downloaded. Can be used multiple times
  --report-pid           report any existing sync PID
  --aggressive           KILL any other running sync process
                         (the default is to fail to start if another sync process is running)
  --logdir=[log_dir]     logging base directory
  --logging=[log_conf]   override log configuration file
  --loglevel=[log_conf]  set the console output log level
"""
	tag_list = []
	argv = unicode_argv(argv)

	(opts, argv) = getopt(argv, *all_options)
	for (key,val) in opts:
		if key in ['-c','--config','-s','--show-status', '--logging', '--logdir', '--loglevel']:
			# already processed
			pass
		
		elif key == '-C' or key == '--cautious':
			set_opt('cautious', True)
			info("Cautious mode enabled...")
		elif key == '-n' or key == '--num-items':
			set_opt('num_items', int(val))
			info("Number of items set to %s" % app_globals.OPTIONS['num_items'])
		elif key == '-d' or key == '--no-download':
			set_opt('no_download', True)
			info("Downloading turned off..")
		elif key == '-t' or key == '--test':
			set_opt('test', True)
		elif key == '-h' or key == '--help':
			print parse_options.__doc__
			sys.exit(1)
		elif key == '--password':
			set_opt('password',val, disguise = True);
		elif key == '--tag':
			tag_list.append(val)
			set_opt('tag_list', tag_list)

		else:
			if key.startswith('--') and key[2:] in main_options[1]:
				# it's a flag
				val = True
			success = set_opt(key, val)
			if not success:
				print "unknown option: %s" % (key,)
				print parse_options.__doc__ 
				sys.exit(1)

	if len(argv) > 0:
		set_opt('num_items', int(argv[0]))
		info("Number of items set to %s" % app_globals.OPTIONS['num_items'])
        


src/g/o/google-reader-iphone-sync-HEAD/src/sync/main.py   google-reader-iphone-sync(Download)
	config.init_logging()
	config.load()
	config.parse_options(opts)
	ensure_dir_exists(app_globals.OPTIONS['output_path'])
	log_start()

src/p/y/pylama-3.1.0/pylama/main.py   pylama(Download)
from os import walk, path as op
 
from .config import parse_options, CURDIR, setup_logger
from .core import LOGGER
 
        args = sys.argv[1:]
 
    options = parse_options(args)
    setup_logger(options)
    LOGGER.info(options)

src/p/y/Python-mode-klen-HEAD/pymode/libs/pylama/main.py   Python-mode-klen(Download)
from os import walk, path as op
 
from .config import parse_options, CURDIR, setup_logger
from .core import LOGGER
 
        args = sys.argv[1:]
 
    options = parse_options(args)
    setup_logger(options)
    LOGGER.info(options)

src/p/y/pylama-HEAD/pylama/main.py   pylama(Download)
from os import walk, path as op
 
from .config import parse_options, CURDIR, setup_logger
from .core import LOGGER
 
        args = sys.argv[1:]
 
    options = parse_options(args)
    setup_logger(options)
    LOGGER.info(options)

src/p/y/pylama-3.1.0/pylama/hook.py   pylama(Download)
 
from .main import LOGGER
from .config import parse_options, setup_logger
 
 
    _, files_modified, _ = run("git diff-index --cached --name-only HEAD")
 
    options = parse_options()
    setup_logger(options)
    check_files([f for f in map(str, files_modified)], options)
                paths.append(file_)
 
    options = parse_options()
    setup_logger(options)
    check_files(paths, options)

src/p/y/Python-mode-klen-HEAD/pymode/libs/pylama/hook.py   Python-mode-klen(Download)
 
from .main import LOGGER
from .config import parse_options, setup_logger
 
 
    _, files_modified, _ = run("git diff-index --cached --name-only HEAD")
 
    options = parse_options()
    setup_logger(options)
    check_files([f for f in map(str, files_modified)], options)
                paths.append(file_)
 
    options = parse_options()
    setup_logger(options)
    check_files(paths, options)

src/p/y/pylama-HEAD/pylama/hook.py   pylama(Download)
 
from .main import LOGGER
from .config import parse_options, setup_logger
 
 
    _, files_modified, _ = run("git diff-index --cached --name-only HEAD")
 
    options = parse_options()
    setup_logger(options)
    check_files([f for f in map(str, files_modified)], options)
                paths.append(file_)
 
    options = parse_options()
    setup_logger(options)
    check_files(paths, options)

src/g/o/google-reader-iphone-sync-HEAD/src/sync/google_reader_test.py   google-reader-iphone-sync(Download)
		# make sure we're not mocking out google reader
		app_globals.OPTIONS['test'] = False
		config.parse_options(['--output-path=/tmp/gris-test', '--num-items=1'])
		config.check()
		self.reader = app_globals.READER = Reader()

src/g/o/google-reader-iphone-sync-HEAD/src/sync/config_test.py   google-reader-iphone-sync(Download)
			config.bootstrap(args)
			print "configging with %s" % args
			config.parse_options(args)
 
	def test_should_load_plist(self):

src/g/o/google-reader-iphone-sync-HEAD/src/sync/test_helper.py   google-reader-iphone-sync(Download)
def init_output_folder():
	output_folder = '/tmp/GRiS/test_entries'
	config.parse_options(['--test','--num-items=3','--logdir=/tmp/GRiS/logs', '--output-path=%s' % output_folder])
 
	assert app_globals.OPTIONS['output_path'] == output_folder

  1 | 2  Next