Example #1
0
def afwebgui():
	cgruutils.webbrowse(
		'%s:%s' % (
			cgruconfig.VARS['af_servername'],
			cgruconfig.VARS['af_serverport']
		)
	)
Example #2
0
def show(i_path=None):
	docs_host = 'docs_host'

	location = ''
	if docs_host in cgruconfig.VARS:
		docs_host = cgruconfig.VARS[docs_host]
		if docs_host is not None and docs_host != '':
			location = 'http://%s' % docs_host
			if i_path is not None:
				if i_path[0] == '/' or i_path[0] == '\\':
					location += i_path
				else:
					location = '%s/%s' % (location, i_path)
	else:
		cgrulocation = os.getenv('CGRU_LOCATION')
		if cgrulocation is None or cgrulocation == '':
			print('No "%s" variable and "CGRU_LOCATION" is set.' % docs_host)
			return
		location = cgrulocation
		if i_path is None or i_path == '':
			i_path = 'index.html'
		if i_path[0] == '/' or i_path[0] == '\\':
			location += i_path
		else:
			location = os.path.join(location, i_path)

	cgruutils.webbrowse(location)
Example #3
0
def openShot( i_path, i_verbose = False):
	"""
		Open Rules Shot URL from given path to any file/folder in the shot
	"""
	url = getShotURL( i_path, i_verbose)
	if url:
		if i_verbose:
			print('URL = %s' % url)
		cgruutils.webbrowse( url)
Example #4
0
def openPath( i_path, i_verbose = False):
	"""
		Open path in Rules
	"""
	url = getPathURL( i_path, i_verbose)
	if url:
		if i_verbose:
			print('URL = %s' % url)
		cgruutils.webbrowse( url)
Example #5
0
def show(i_path=None):

    url = cgruconfig.VARS['docs_url']

    if i_path is not None:
        i_path.rstrip('/')
        url = '%s/%s' % (url, i_path)

    cgruutils.webbrowse(url)
Example #6
0
def show(i_path=None):

    url = cgruconfig.VARS['docs_url']

    if i_path is not None:
        i_path.rstrip('/')
        url = '%s/%s' % (url, i_path)

    cgruutils.webbrowse( url)
Example #7
0
def showForum(i_forum=None):

    forums = dict()
    forums['nuke'] = 20
    forums['watch'] = 16

    url = cgruconfig.VARS['forum_url']

    if i_forum is not None and i_forum in forums:
        url += '/viewforum.php?f=%d' % forums[i_forum]

    cgruutils.webbrowse(url)
Example #8
0
def showForum( i_forum = None):

    forums = dict()
    forums['nuke']  = 20
    forums['watch'] = 16

    url = cgruconfig.VARS['forum_url']

    if i_forum is not None and i_forum in forums:
        url += '/viewforum.php?f=%d' % forums[i_forum]

    cgruutils.webbrowse( url)
Example #9
0
def rulesOpenShot():
	path = nuke.root().name()
	print('Scene = ' + path)

	print('Scenes:')
	print(cgruconfig.VARS['rules_scenes'])
	for scn in cgruconfig.VARS['rules_scenes']:
		path = path.split(scn)[0]
	print('Shot = %s' % path)

	print('Projects:')
	print(cgruconfig.VARS['rules_projects'])
	for prj in cgruconfig.VARS['rules_projects']:
		path = path.replace(prj, '')
	print('Path = %s' % path)

	path = cgruconfig.VARS['rules_url'] + path
	print('URL = %s' % path)

	cgruutils.webbrowse(path)
Example #10
0
                  help='Verbose mode')
Parser.add_option('-D',
                  '--debug',
                  dest='debug',
                  action='store_true',
                  default=False,
                  help='Debug mode')
Options, Args = Parser.parse_args()

if Options.debug:
    Options.verbose = True

if not 'rules_url' in cgruconfig.VARS:
    print('Rules URL is not defined.')
    sys.exit(1)

Location = None
if len(Args):
    Location = Args[-1]
else:
    cgruutils.webbrowse(cgruconfig.VARS['rules_url'])
    sys.exit(0)

if Options.verbose:
    print('Opening "%s"' % Location)

if Options.shot:
    cgrules.openShot(Location, Options.verbose)
else:
    cgrules.openPath(Location, Options.verbose)
Example #11
0
def afwebgui():
    cgruutils.webbrowse(
        '%s:%s' %
        (cgruconfig.VARS['af_servername'], cgruconfig.VARS['af_serverport']))
Example #12
0
def openShot(i_path, i_verbose=False):
    cgruutils.webbrowse(getShotURL(i_path, i_verbose))
Example #13
0
File: rules.py Project: CGRU/cgru
from optparse import OptionParser
Parser = OptionParser(usage="%prog [Options] output\nType \"%prog -h\" for help", version="%prog 1.0")
Parser.add_option('-s', '--shot',    dest='shot',    action='store_true', default=False, help='Open shot')
Parser.add_option('-V', '--verbose', dest='verbose', action='store_true', default=False, help='Verbose mode')
Parser.add_option('-D', '--debug',   dest='debug',   action='store_true', default=False, help='Debug mode')
Options, Args = Parser.parse_args()

if Options.debug:
	Options.verbose = True

if not 'rules_url' in cgruconfig.VARS:
	print('Rules URL is not defined.')
	sys.exit(1)

Location = None
if len(Args):
	Location = Args[-1]
else:
	cgruutils.webbrowse( cgruconfig.VARS['rules_url'])
	sys.exit(0)

if Options.verbose:
	print('Opening "%s"' % Location)

if Options.shot:
	cgrules.openShot( Location, Options.verbose)
else:
	cgrules.openPath( Location, Options.verbose)

Example #14
0
def openShot(i_path, i_verbose=False):
    cgruutils.webbrowse(getShotURL(i_path, i_verbose))
Example #15
0
 def httpsServer(self):
     cgruutils.webbrowse('https://localhost:' +
                         str(cgruconfig.VARS['keeper_port_https']) + '/')
Example #16
0
def afwebgui(): cgruutils.webbrowse( cgruconfig.VARS['af_servername']+':'+str(cgruconfig.VARS['af_serverport']))

def exitRender(  text = '(keeper)'): af.Cmd().renderExit( text)
Example #17
0
File: tray.py Project: CGRU/cgru
 def httpsServer(self):
     cgruutils.webbrowse('https://localhost:' + str(cgruconfig.VARS['keeper_port_https']) + '/')