galaxy-dev
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- 10008 discussions

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/43b7a7f4bff5
changeset: 3605:43b7a7f4bff5
user: rc
date: Fri Apr 02 15:09:29 2010 -0400
description:
lims: default values for forms now working for text fields
diffstat:
lib/galaxy/model/__init__.py | 4 ++--
lib/galaxy/web/controllers/forms.py | 24 ++++++++++++++++++------
2 files changed, 20 insertions(+), 8 deletions(-)
diffs (107 lines):
diff -r 3914645ecccb -r 43b7a7f4bff5 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py Fri Apr 02 15:00:53 2010 -0400
+++ b/lib/galaxy/model/__init__.py Fri Apr 02 15:09:29 2010 -0400
@@ -1348,8 +1348,8 @@
# Since we do not have contents, set checkbox value to False
value = False
else:
- # Set other field types to empty string
- value = ''
+ # Set other field types to the default value of the field
+ value = field['default']
# create the field widget
field_widget = eval( field[ 'type' ] )( field_name )
if field[ 'type' ] == 'TextField':
diff -r 3914645ecccb -r 43b7a7f4bff5 lib/galaxy/web/controllers/forms.py
--- a/lib/galaxy/web/controllers/forms.py Fri Apr 02 15:00:53 2010 -0400
+++ b/lib/galaxy/web/controllers/forms.py Fri Apr 02 15:09:29 2010 -0400
@@ -72,7 +72,8 @@
'required': False,
'type': BaseField.form_field_types()[0],
'selectlist': [],
- 'layout': 'none' }
+ 'layout': 'none',
+ 'default': '' }
forms_grid = FormsGrid()
@web.expose
@@ -354,6 +355,7 @@
required = params.get( 'field_required_%i' % index, False )
field_type = util.restore_text( params.get( 'field_type_%i' % index, '' ) )
layout = params.get( 'field_layout_%i' % index, '' )
+ default = params.get( 'field_default_%i' % index, '' )
if field_type == 'SelectField':
selectlist = self.__get_selectbox_options(index, **kwd)
return {'label': name,
@@ -362,13 +364,15 @@
'required': required,
'type': field_type,
'selectlist': selectlist,
- 'layout': layout }
+ 'layout': layout,
+ 'default': default }
return {'label': name,
'helptext': helptext,
'visible': True,
'required': required,
'type': field_type,
- 'layout': layout}
+ 'layout': layout,
+ 'default': default}
def __get_selectbox_options(self, index, **kwd):
'''
This method gets all the options entered by the user for field when
@@ -453,7 +457,8 @@
'required': row[3],
'type': row[4],
'selectlist': options,
- 'layout':row[6]})
+ 'layout':row[6],
+ 'default': row[7]})
layouts.add(row[6])
else:
for row in reader:
@@ -463,7 +468,8 @@
'visible': row[2],
'required': row[3],
'type': row[4],
- 'selectlist': options})
+ 'selectlist': options,
+ 'default': row[7]})
except:
return trans.response.send_redirect( web.url_for( controller='forms',
action='new',
@@ -549,7 +555,9 @@
if layout_grids:
self.layout_selectbox = SelectField('field_layout_'+str(index))
for index, grid_name in enumerate(layout_grids):
- self.layout_selectbox.add_option("%i. %s" %(index+1, grid_name), index)
+ self.layout_selectbox.add_option("%i. %s" %(index+1, grid_name), index)
+ # default value
+ self.default = TextField('field_default_'+str(index), 40, '')
if field:
self.fill(trans, field, field_type, form_type)
def fill(self, trans, field, field_type=None, form_type=None):
@@ -557,6 +565,8 @@
self.label.value = field['label']
# helptext
self.helptext.value = field['helptext']
+ # default value
+ self.default.value = field['default']
# type
self.fieldtype = SelectField('field_type_'+str(self.index),
refresh_on_change=True,
@@ -608,11 +618,13 @@
return [( 'Label', self.label ),
( 'Help text', self.helptext ),
( 'Type', self.fieldtype, self.selectbox_options),
+ ( 'Default value', self.default ),
( '', self.required),
( 'Select the grid layout to place this field', self.layout_selectbox)]
return [( 'Label', self.label ),
( 'Help text', self.helptext ),
( 'Type', self.fieldtype, self.selectbox_options),
+ ( 'Default value', self.default ),
( '', self.required)]
def __repr__(self):
return str(self.index)+'.'+self.label
1
0

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/3914645ecccb
changeset: 3604:3914645ecccb
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Fri Apr 02 15:00:53 2010 -0400
description:
Handle user registration and login in the galaxy_main frame to ensure masthead. After registration or login, use javascript to redirect to the page the user was viewing when they attempted login. If javascript is disabled, a page will be displayed with links to the page they were visiting or the home page. Revamp functional tests to cover new behavior. Fix bugs where the username was not validated when a user registered, and add functional tests to cover. Fix a bug where the user's new session may have set it's history to the user's previous history, even if the history was deleted. Now a new history will be created for the current session instead. Add a new logout.mako template, and remove a create.mako template that was no longer used.
diffstat:
lib/galaxy/web/controllers/admin.py | 65 +------
lib/galaxy/web/controllers/user.py | 258 +++++++++-----------------
lib/galaxy/web/framework/__init__.py | 11 +-
templates/admin/user/create.mako | 43 ----
templates/library/common/browse_library.mako | 1 -
templates/user/index.mako | 16 +-
templates/user/login.mako | 51 +++--
templates/user/logout.mako | 6 +
templates/user/register.mako | 120 +++++++-----
templates/webapps/galaxy/base_panels.mako | 10 +-
test/base/twilltestcase.py | 82 ++++++--
test/functional/test_admin_features.py | 25 ++-
12 files changed, 301 insertions(+), 387 deletions(-)
diffs (969 lines):
diff -r 72daa0d41d1b -r 3914645ecccb lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Fri Apr 02 14:34:35 2010 -0400
+++ b/lib/galaxy/web/controllers/admin.py Fri Apr 02 15:00:53 2010 -0400
@@ -711,69 +711,6 @@
return trans.response.send_redirect( web.url_for( controller='user',
action='create',
admin_view=True ) )
- email = ''
- password = ''
- confirm = ''
- subscribe = False
- email_filter = kwargs.get( 'email_filter', 'A' )
- if 'user_create_button' in kwargs:
- message = ''
- status = ''
- email = kwargs.get( 'email' , None )
- password = kwargs.get( 'password', None )
- confirm = kwargs.get( 'confirm', None )
- subscribe = kwargs.get( 'subscribe', None )
- if not email:
- message = 'Enter a valid email address'
- elif not password:
- message = 'Enter a valid password'
- elif not confirm:
- message = 'Confirm the password'
- elif len( email ) == 0 or "@" not in email or "." not in email:
- message = 'Enter a real email address'
- elif len( email) > 255:
- message = 'Email address exceeds maximum allowable length'
- elif trans.sa_session.query( trans.app.model.User ).filter_by( email=email ).first():
- message = 'User with that email already exists'
- elif len( password ) < 6:
- message = 'Use a password of at least 6 characters'
- elif password != confirm:
- message = 'Passwords do not match'
- if message:
- trans.response.send_redirect( web.url_for( controller='admin',
- action='users',
- email_filter=email_filter,
- message=util.sanitize_text( message ),
- status='error' ) )
- else:
- user = trans.app.model.User( email=email )
- user.set_password_cleartext( password )
- if trans.app.config.use_remote_user:
- user.external = True
- trans.sa_session.add( user )
- trans.sa_session.flush()
- trans.app.security_agent.create_private_user_role( user )
- trans.app.security_agent.user_set_default_permissions( user, history=False, dataset=False )
- message = 'Created new user account (%s)' % user.email
- status = 'done'
- #subscribe user to email list
- if subscribe:
- mail = os.popen( "%s -t" % trans.app.config.sendmail_path, 'w' )
- mail.write( "To: %s\nFrom: %s\nSubject: Join Mailing List\n\nJoin Mailing list." % ( trans.app.config.mailing_join_addr, email ) )
- if mail.close():
- message + ". However, subscribing to the mailing list has failed."
- status = 'error'
- trans.response.send_redirect( web.url_for( controller='admin',
- action='users',
- email_filter=email_filter,
- message=util.sanitize_text( message ),
- status=status ) )
- return trans.fill_template( '/admin/user/create.mako',
- email_filter=email_filter,
- email=email,
- password=password,
- confirm=confirm,
- subscribe=subscribe )
@web.expose
@web.require_admin
def reset_user_password( self, trans, **kwd ):
@@ -916,7 +853,7 @@
status='done' ) )
@web.expose
@web.require_admin
- def users( self, trans, **kwargs ):
+ def users( self, trans, **kwargs ):
if 'operation' in kwargs:
operation = kwargs['operation'].lower()
if operation == "roles":
diff -r 72daa0d41d1b -r 3914645ecccb lib/galaxy/web/controllers/user.py
--- a/lib/galaxy/web/controllers/user.py Fri Apr 02 14:34:35 2010 -0400
+++ b/lib/galaxy/web/controllers/user.py Fri Apr 02 15:00:53 2010 -0400
@@ -26,23 +26,24 @@
class User( BaseController ):
@web.expose
def index( self, trans, webapp='galaxy', **kwd ):
- return trans.fill_template( '/user/index.mako', user=trans.get_user(), webapp=webapp )
+ return trans.fill_template( '/user/index.mako', webapp=webapp )
@web.expose
- def login( self, trans, webapp='galaxy', **kwd ):
+ def login( self, trans, webapp='galaxy', redirect_url='', refresh_frames=[], **kwd ):
+ referer = kwd.get( 'referer', trans.request.referer )
use_panels = util.string_as_bool( kwd.get( 'use_panels', True ) )
msg = kwd.get( 'msg', '' )
messagetype = kwd.get( 'messagetype', 'done' )
+ header = ''
+ user = None
+ email = kwd.get( 'email', '' )
if kwd.get( 'login_button', False ):
- email = kwd.get( 'email', '' )
password = kwd.get( 'password', '' )
referer = kwd.get( 'referer', '' )
- if webapp == 'galaxy':
+ if webapp == 'galaxy' and not refresh_frames:
if trans.app.config.require_login:
refresh_frames = [ 'masthead', 'history', 'tools' ]
else:
refresh_frames = [ 'masthead', 'history' ]
- else:
- refresh_frames = []
user = trans.sa_session.query( trans.app.model.User ).filter( trans.app.model.User.table.c.email==email ).first()
if not user:
msg = "No such user"
@@ -59,38 +60,27 @@
else:
trans.handle_user_login( user, webapp )
trans.log_event( "User logged in" )
- msg = "You are now logged in as %s.<br>You can <a href='%s'>go back to the page you were visiting</a> or <a href='%s'>go to the home page</a>." % \
+ msg = 'You are now logged in as %s.<br>You can <a target="_top" href="%s">go back to the page you were visiting</a> or <a target="_top" href="%s">go to the home page</a>.' % \
( user.email, referer, url_for( '/' ) )
if trans.app.config.require_login:
- msg += ' <a href="%s">Click here</a> to continue to the home page.' % web.url_for( '/static/welcome.html' )
- return trans.response.send_redirect( web.url_for( controller='user',
- action='login',
- use_panels=use_panels,
- msg=msg,
- message_type='done' ) )
- if trans.app.config.require_login:
+ msg += ' <a target="_top" href="%s">Click here</a> to continue to the home page.' % web.url_for( '/static/welcome.html' )
+ redirect_url = referer
+ if not user and trans.app.config.require_login:
if trans.app.config.allow_user_creation:
- return trans.fill_template( '/user/login.mako',
- webapp=webapp,
- header=require_login_creation_template % web.url_for( action='create' ),
- use_panels=use_panels,
- msg=msg,
- messagetype=messagetype,
- active_view="user" )
+ header = require_login_creation_template % web.url_for( action='create' )
else:
- return trans.fill_template( '/user/login.mako',
- webapp=webapp,
- header=require_login_nocreation_template,
- use_panels=use_panels,
- msg=msg,
- messagetype=messagetype,
- active_view="user" )
+ header = require_login_nocreation_template
return trans.fill_template( '/user/login.mako',
webapp=webapp,
+ email=email,
+ header=header,
use_panels=use_panels,
+ redirect_url=redirect_url,
+ referer=referer,
+ refresh_frames=refresh_frames,
msg=msg,
messagetype=messagetype,
- active_view="use" )
+ active_view="user" )
@web.expose
def logout( self, trans, webapp='galaxy' ):
if webapp == 'galaxy':
@@ -103,18 +93,18 @@
# Since logging an event requires a session, we'll log prior to ending the session
trans.log_event( "User logged out" )
trans.handle_user_logout()
- msg = "You have been logged out.<br>You can log in again, <a href='%s'>go back to the page you were visiting</a> or <a href='%s'>go to the home page</a>." % \
+ msg = 'You have been logged out.<br>You can log in again, <a target="_top" href="%s">go back to the page you were visiting</a> or <a target="_top" href="%s">go to the home page</a>.' % \
( trans.request.referer, url_for( '/' ) )
- return trans.response.send_redirect( web.url_for( controller='user',
- action='login',
- msg=msg,
- message_type='done' ) )
+ return trans.fill_template( '/user/logout.mako',
+ webapp=webapp,
+ refresh_frames=refresh_frames,
+ msg=msg,
+ messagetype='done',
+ active_view="user" )
@web.expose
- def create( self, trans, webapp='galaxy', **kwd ):
+ def create( self, trans, webapp='galaxy', redirect_url='', refresh_frames=[], **kwd ):
params = util.Params( kwd )
- use_panels = kwd.get( 'use_panels', 'True' )
- # Convert use_panels to Boolean.
- use_panels = use_panels in [ 'True', 'true', 't', 'T' ]
+ use_panels = util.string_as_bool( kwd.get( 'use_panels', True ) )
email = util.restore_text( params.get( 'email', '' ) )
# Do not sanitize passwords, so take from kwd
# instead of params ( which were sanitized )
@@ -126,123 +116,56 @@
admin_view = util.string_as_bool( params.get( 'admin_view', False ) )
msg = util.restore_text( params.get( 'msg', '' ) )
messagetype = params.get( 'messagetype', 'done' )
- if webapp == 'galaxy':
+ referer = kwd.get( 'referer', trans.request.referer )
+ if not refresh_frames and webapp == 'galaxy':
if trans.app.config.require_login:
refresh_frames = [ 'masthead', 'history', 'tools' ]
else:
refresh_frames = [ 'masthead', 'history' ]
- else:
- refresh_frames = []
+ error = ''
if not trans.app.config.allow_user_creation and not trans.user_is_admin():
- msg = 'User registration is disabled. Please contact your Galaxy administrator for an account.'
- return trans.response.send_redirect( web.url_for( controller='user',
- action='create',
- webapp=webapp,
- email=email,
- password=password,
- confirm=confirm,
- username=username,
- subscribe=subscribe,
- subscribe_checked=subscribe_checked,
- admin_view=admin_view,
- use_panels=use_panels,
- refresh_frames=refresh_frames,
- msg=error,
- messagetype='error' ) )
+ error = 'User registration is disabled. Please contact your Galaxy administrator for an account.'
# Create the user, save all the user info and login to Galaxy
- if params.get( 'create_user_button', False ):
+ elif params.get( 'create_user_button', False ):
# Check email and password validity
- error = self.__validate( trans, params, email, password, confirm, webapp )
- if error:
- return trans.response.send_redirect( web.url_for( controller='user',
- action='create',
- webapp=webapp,
- email=email,
- password=password,
- confirm=confirm,
- username=username,
- subscribe=subscribe,
- subscribe_checked=subscribe_checked,
- admin_view=admin_view,
- use_panels=use_panels,
- refresh_frames=refresh_frames,
- msg=error,
- messagetype='error' ) )
- # all the values are valid
- user = trans.app.model.User( email=email )
- user.set_password_cleartext( password )
- user.username = username
- trans.sa_session.add( user )
- trans.sa_session.flush()
- trans.app.security_agent.create_private_user_role( user )
- if webapp == 'galaxy':
- # We set default user permissions, before we log in and set the default history permissions
- trans.app.security_agent.user_set_default_permissions( user,
- default_access_private=trans.app.config.new_user_dataset_access_role_default_private )
- # save user info
- self.__save_user_info( trans, user, action='create', new_user=True, **kwd )
- if subscribe_checked:
- mail = os.popen( "%s -t" % trans.app.config.sendmail_path, 'w' )
- mail.write( "To: %s\nFrom: %s\nSubject: Join Mailing List\n\nJoin Mailing list." % ( trans.app.config.mailing_join_addr,email ) )
- if mail.close():
- msg = "Now logged in as " + user.email + ". However, subscribing to the mailing list has failed."
- return trans.response.send_redirect( web.url_for( controller='user',
- action='create',
- webapp=webapp,
- email=email,
- password=password,
- confirm=confirm,
- username=username,
- subscribe=subscribe,
- subscribe_checked=subscribe_checked,
- admin_view=admin_view,
- use_panels=use_panels,
- refresh_frames=refresh_frames,
- msg=error,
- messagetype='warn' ) )
- if not admin_view:
- # The handle_user_login() method has a call to the history_set_default_permissions() method
- # (needed when logging in with a history), user needs to have default permissions set before logging in
- trans.handle_user_login( user, webapp )
- trans.log_event( "User created a new account" )
- trans.log_event( "User logged in" )
- # subscribe user to email list
- msg = "Now logged in as %s.<br><a href='%s'>Return to the home page.</a>" % ( user.email, url_for( '/' ) )
- return trans.response.send_redirect( web.url_for( controller='user',
- action='create',
- webapp=webapp,
- email=email,
- password=password,
- confirm=confirm,
- username=username,
- subscribe=subscribe,
- subscribe_checked=subscribe_checked,
- admin_view=admin_view,
- use_panels=True,
- refresh_frames=refresh_frames,
- msg=msg,
- messagetype='done' ) )
- else:
- trans.response.send_redirect( web.url_for( controller='admin',
- action='users',
- message='Created new user account (%s)' % user.email,
- status='done' ) )
- else:
- msg = "Now logged in as %s.<br><a href='%s'>Return to the home page.</a>" % ( user.email, url_for( '/' ) )
- return trans.response.send_redirect( web.url_for( controller='user',
- action='create',
- webapp=webapp,
- email=email,
- password=password,
- confirm=confirm,
- username=username,
- subscribe=subscribe,
- subscribe_checked=subscribe_checked,
- admin_view=admin_view,
- use_panels=False,
- refresh_frames=refresh_frames,
- msg=error,
- messagetype='done' ) )
+ error = self.__validate( trans, params, email, password, confirm, username, webapp )
+ if not error:
+ # all the values are valid
+ user = trans.app.model.User( email=email )
+ user.set_password_cleartext( password )
+ user.username = username
+ trans.sa_session.add( user )
+ trans.sa_session.flush()
+ trans.app.security_agent.create_private_user_role( user )
+ msg = 'Now logged in as %s.<br><a target="_top" href="%s">Return to the home page.</a>' % ( user.email, url_for( '/' ) )
+ if webapp == 'galaxy':
+ # We set default user permissions, before we log in and set the default history permissions
+ trans.app.security_agent.user_set_default_permissions( user,
+ default_access_private=trans.app.config.new_user_dataset_access_role_default_private )
+ # save user info
+ self.__save_user_info( trans, user, action='create', new_user=True, **kwd )
+ if subscribe_checked:
+ # subscribe user to email list
+ mail = os.popen( "%s -t" % trans.app.config.sendmail_path, 'w' )
+ mail.write( "To: %s\nFrom: %s\nSubject: Join Mailing List\n\nJoin Mailing list." % ( trans.app.config.mailing_join_addr,email ) )
+ if mail.close():
+ error = "Now logged in as " + user.email + ". However, subscribing to the mailing list has failed."
+ if not error and not admin_view:
+ # The handle_user_login() method has a call to the history_set_default_permissions() method
+ # (needed when logging in with a history), user needs to have default permissions set before logging in
+ trans.handle_user_login( user, webapp )
+ trans.log_event( "User created a new account" )
+ trans.log_event( "User logged in" )
+ elif not error:
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='users',
+ message='Created new user account (%s)' % user.email,
+ status='done' ) )
+ if not error:
+ redirect_url = referer
+ if error:
+ msg=error
+ messagetype='error'
if webapp == 'galaxy':
user_info_select, user_info_form, widgets = self.__user_info_ui( trans, **kwd )
else:
@@ -261,6 +184,9 @@
widgets=widgets,
webapp=webapp,
use_panels=use_panels,
+ referer=referer,
+ redirect_url=redirect_url,
+ refresh_frames=refresh_frames,
msg=msg,
messagetype=messagetype )
def __save_user_info(self, trans, user, action, new_user=True, **kwd):
@@ -371,7 +297,7 @@
if len( username ) > 255:
return "User name cannot be more than 255 characters in length"
if not( VALID_USERNAME_RE.match( username ) ):
- return "User name must contain only letters, numbers and '-'"
+ return "User name must contain only lower-case letters, numbers and '-'"
if trans.sa_session.query( trans.app.model.User ).filter_by( username=username ).first():
return "This user name is not available"
return None
@@ -382,24 +308,24 @@
elif password != confirm:
error = "Passwords do not match"
return error
- def __validate( self, trans, params, email, password, confirm, webapp ):
+ def __validate( self, trans, params, email, password, confirm, username, webapp ):
error = self.__validate_email( trans, email )
- if error:
- return error
- error = self.__validate_password( trans, password, confirm )
- if error:
- return error
- if webapp == 'galaxy':
- # TODO: the user controller must be decoupled from the model, so this import causes problems.
- # The get_all_forms method is used only if Galaxy is the webapp, so it needs to be re-worked
- # so that it can be imported with no problems if the controller is not 'galaxy'.
- from galaxy.web.controllers.forms import get_all_forms
- if len( get_all_forms( trans,
- filter=dict( deleted=False ),
- form_type=trans.app.model.FormDefinition.types.USER_INFO ) ):
- if params.get( 'user_info_select', 'none' ) == 'none':
- return 'Select the user type and the user information'
- return None
+ if not error:
+ error = self.__validate_password( trans, password, confirm )
+ if not error and username:
+ error = self.__validate_username( trans, username )
+ if not error:
+ if webapp == 'galaxy':
+ # TODO: the user controller must be decoupled from the model, so this import causes problems.
+ # The get_all_forms method is used only if Galaxy is the webapp, so it needs to be re-worked
+ # so that it can be imported with no problems if the controller is not 'galaxy'.
+ from galaxy.web.controllers.forms import get_all_forms
+ if len( get_all_forms( trans,
+ filter=dict( deleted=False ),
+ form_type=trans.app.model.FormDefinition.types.USER_INFO ) ):
+ if not params.get( 'user_info_select', False ):
+ return 'Select the user type and the user information'
+ return error
def __user_info_ui(self, trans, user=None, **kwd):
'''
This method creates the user type select box & user information form widgets
diff -r 72daa0d41d1b -r 3914645ecccb lib/galaxy/web/framework/__init__.py
--- a/lib/galaxy/web/framework/__init__.py Fri Apr 02 14:34:35 2010 -0400
+++ b/lib/galaxy/web/framework/__init__.py Fri Apr 02 15:00:53 2010 -0400
@@ -72,7 +72,7 @@
return func( self, trans, *args, **kwargs )
else:
return trans.show_error_message(
- "You must be <a target='_top' href='%s'>logged in</a> to %s</div>."
+ 'You must be <a target="_top" href="%s">logged in</a> to %s</div>.'
% ( url_for( controller='user', action='login' ), verb ), use_panels=use_panels )
return decorator
return argcatcher
@@ -434,14 +434,19 @@
except:
users_last_session = None
last_accessed = False
- if prev_galaxy_session.current_history and prev_galaxy_session.current_history.datasets:
+ if prev_galaxy_session.current_history and \
+ not prev_galaxy_session.current_history.deleted and \
+ prev_galaxy_session.current_history.datasets:
if prev_galaxy_session.current_history.user is None or prev_galaxy_session.current_history.user == user:
# If the previous galaxy session had a history, associate it with the new
# session, but only if it didn't belong to a different user.
history = prev_galaxy_session.current_history
elif self.galaxy_session.current_history:
history = self.galaxy_session.current_history
- if not history and users_last_session and users_last_session.current_history:
+ if not history and \
+ users_last_session and \
+ users_last_session.current_history and \
+ not users_last_session.current_history.deleted:
history = users_last_session.current_history
elif not history:
history = self.get_history( create=True )
diff -r 72daa0d41d1b -r 3914645ecccb templates/admin/user/create.mako
--- a/templates/admin/user/create.mako Fri Apr 02 14:34:35 2010 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Create user account</div>
- <div class="toolFormBody">
- <form name="form" action="${h.url_for( controller='admin', action='create_new_user', email_filter=email_filter )}" method="post" >
- <div class="form-row">
- <label>Email address:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="email" value="${email}" size="40">
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Password:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="password" name="password" value="${password}" size="40">
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Confirm password:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="password" name="confirm" value="${confirm}" size="40">
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Subscribe To Mailing List:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="checkbox" name="subscribe" value="${subscribe}" size="40">
- </div>
- <div style="clear: both"></div>
- </div>
- <input type="submit" name="user_create_button" value="Create">
- </form>
- </div>
-</div>
diff -r 72daa0d41d1b -r 3914645ecccb templates/library/common/browse_library.mako
--- a/templates/library/common/browse_library.mako Fri Apr 02 14:34:35 2010 -0400
+++ b/templates/library/common/browse_library.mako Fri Apr 02 15:00:53 2010 -0400
@@ -30,7 +30,6 @@
${render_content()}
</div>
</div>
- ##${render_content()}
</%def>
## Render the grid's basic elements. Each of these elements can be subclassed.
diff -r 72daa0d41d1b -r 3914645ecccb templates/user/index.mako
--- a/templates/user/index.mako Fri Apr 02 14:34:35 2010 -0400
+++ b/templates/user/index.mako Fri Apr 02 15:00:53 2010 -0400
@@ -1,11 +1,13 @@
<%inherit file="/base.mako"/>
-<%def name="title()">User preferences</%def>
+<%namespace file="/message.mako" import="render_msg" />
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
-<h2>${_('User preferences')}</h2>
-
-%if user:
- <p>You are currently logged in as ${user.email}.</p>
+%if trans.user:
+ <h2>${_('User preferences')}</h2>
+ <p>You are currently logged in as ${trans.user.email}.</p>
<ul>
%if webapp == 'galaxy':
<li><a href="${h.url_for( action='show_info' )}">${_('Manage your information')}</a></li>
@@ -14,7 +16,9 @@
<li><a href="${h.url_for( action='logout' )}">${_('Logout')}</a></li>
</ul>
%else:
- <p>${n_('You are currently not logged in.')}</p>
+ %if not msg:
+ <p>${n_('You are currently not logged in.')}</p>
+ %endif
<ul>
<li><a href="${h.url_for( action='login' )}">${_('Login')}</li>
<li><a href="${h.url_for( action='create' )}">${_('Register')}</a></li>
diff -r 72daa0d41d1b -r 3914645ecccb templates/user/login.mako
--- a/templates/user/login.mako Fri Apr 02 14:34:35 2010 -0400
+++ b/templates/user/login.mako Fri Apr 02 15:00:53 2010 -0400
@@ -1,30 +1,39 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
-%if msg:
+%if redirect_url:
+ <script type="text/javascript">
+ top.location.href = '${redirect_url}';
+ </script>
+%endif
+
+%if not redirect_url and msg:
${render_msg( msg, messagetype )}
%endif
-<div class="toolForm">
- <div class="toolFormTitle">Login</div>
+
+%if not trans.user:
%if header:
${header}
%endif
- <form name="login" id="login" action="${h.url_for( controller='user', action='login' )}" method="post" >
- <div class="form-row">
- <label>Email address:</label>
- <input type="text" name="email" value="" size="40"/>
- <input type="hidden" name="webapp" value="${webapp}" size="40"/>
- <input type="hidden" name="referer" value="${trans.request.referer}" size="40"/>
- </div>
- <div class="form-row">
- <label>Password:</label>
- <input type="password" name="password" value="" size="40"/>
- <div class="toolParamHelp" style="clear: both;">
- <a href="${h.url_for( controller='user', action='reset_password', webapp=webapp, use_panels=use_panels )}">Forgot password? Reset here</a>
+ <div class="toolForm">
+ <div class="toolFormTitle">Login</div>
+ <form name="login" id="login" action="${h.url_for( controller='user', action='login' )}" method="post" >
+ <div class="form-row">
+ <label>Email address:</label>
+ <input type="text" name="email" value="${email}" size="40"/>
+ <input type="hidden" name="webapp" value="${webapp}" size="40"/>
+ <input type="hidden" name="referer" value="${referer}" size="40"/>
</div>
- </div>
- <div class="form-row">
- <input type="submit" name="login_button" value="Login"/>
- </div>
- </form>
-</div>
+ <div class="form-row">
+ <label>Password:</label>
+ <input type="password" name="password" value="" size="40"/>
+ <div class="toolParamHelp" style="clear: both;">
+ <a href="${h.url_for( controller='user', action='reset_password', webapp=webapp, use_panels=use_panels )}">Forgot password? Reset here</a>
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="login_button" value="Login"/>
+ </div>
+ </form>
+ </div>
+%endif
diff -r 72daa0d41d1b -r 3914645ecccb templates/user/logout.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/user/logout.mako Fri Apr 02 15:00:53 2010 -0400
@@ -0,0 +1,6 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
diff -r 72daa0d41d1b -r 3914645ecccb templates/user/register.mako
--- a/templates/user/register.mako Fri Apr 02 14:34:35 2010 -0400
+++ b/templates/user/register.mako Fri Apr 02 15:00:53 2010 -0400
@@ -1,6 +1,12 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
+%if redirect_url:
+ <script type="text/javascript">
+ top.location.href = '${redirect_url}';
+ </script>
+%endif
+
<%def name="javascripts()">
${parent.javascripts()}
<script type="text/javascript">
@@ -33,62 +39,70 @@
from galaxy.web.form_builder import CheckboxField
subscribe_check_box = CheckboxField( 'subscribe' )
%>
-%if msg:
+%if not redirect_url and msg:
${render_msg( msg, messagetype )}
%endif
-<div class="toolForm">
- <form name="registration" id="registration" action="${h.url_for( controller='user', action='create', admin_view=admin_view )}" method="post" >
- <div class="toolFormTitle">Create account</div>
- <div class="form-row">
- <label>Email address:</label>
- <input type="text" name="email" value="${email}" size="40"/>
- <input type="hidden" name="webapp" value="${webapp}" size="40"/>
- </div>
- <div class="form-row">
- <label>Password:</label>
- <input type="password" name="password" value="${password}" size="40"/>
- </div>
- <div class="form-row">
- <label>Confirm password:</label>
- <input type="password" name="confirm" value="${confirm}" size="40"/>
- </div>
- <div class="form-row">
- <label>Public user name:</label>
- <input type="text" name="username" size="40" value="${username}"/>
- <div class="toolParamHelp" style="clear: both;">
- When you share or publish items, this name is shown as the author.
+
+## An admin user may be creating a new user account, in which case we want to display the registration form.
+## But if the current user is not an admin user, then don't display the registration form.
+%if trans.user_is_admin() or not trans.user:
+ <div class="toolForm">
+ <form name="registration" id="registration" action="${h.url_for( controller='user', action='create', admin_view=admin_view )}" method="post" >
+ <div class="toolFormTitle">Create account</div>
+ <div class="form-row">
+ <label>Email address:</label>
+ <input type="text" name="email" value="${email}" size="40"/>
+ <input type="hidden" name="webapp" value="${webapp}" size="40"/>
+ <input type="hidden" name="referer" value="${referer}" size="40"/>
</div>
- </div>
- <div class="form-row">
- <label>Subscribe to mailing list:</label>
- %if subscribe_checked:
- <% subscribe_check_box.checked = True %>
+ <div class="form-row">
+ <label>Password:</label>
+ <input type="password" name="password" value="${password}" size="40"/>
+ </div>
+ <div class="form-row">
+ <label>Confirm password:</label>
+ <input type="password" name="confirm" value="${confirm}" size="40"/>
+ </div>
+ <div class="form-row">
+ <label>Public user name:</label>
+ <input type="text" name="username" size="40" value="${username}"/>
+ <div class="toolParamHelp" style="clear: both;">
+ Your user name is an optional identifier that will be used to generate addresses for information
+ you share publicly. User names must be at least four characters in length and contain only lower-case
+ letters, numbers, and the '-' character.
+ </div>
+ </div>
+ <div class="form-row">
+ <label>Subscribe to mailing list:</label>
+ %if subscribe_checked:
+ <% subscribe_check_box.checked = True %>
+ %endif
+ ${subscribe_check_box.get_html()}
+ </div>
+ %if user_info_select:
+ <div class="form-row">
+ <label>User type</label>
+ ${user_info_select.get_html()}
+ </div>
%endif
- ${subscribe_check_box.get_html()}
- </div>
- %if user_info_select:
+ %if user_info_form:
+ %for field in widgets:
+ <div class="form-row">
+ <label>${field['label']}</label>
+ ${field['widget'].get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ ${field['helptext']}
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %endfor
+ %if not user_info_select:
+ <input type="hidden" name="user_info_select" value="${user_info_form.id}"/>
+ %endif
+ %endif
<div class="form-row">
- <label>User type</label>
- ${user_info_select.get_html()}
+ <input type="submit" name="create_user_button" value="Submit"/>
</div>
- %endif
- %if user_info_form:
- %for field in widgets:
- <div class="form-row">
- <label>${field['label']}</label>
- ${field['widget'].get_html()}
- <div class="toolParamHelp" style="clear: both;">
- ${field['helptext']}
- </div>
- <div style="clear: both"></div>
- </div>
- %endfor
- %if not user_info_select:
- <input type="hidden" name="user_info_select" value="${user_info_form.id}"/>
- %endif
- %endif
- <div class="form-row">
- <input type="submit" name="create_user_button" value="Submit"/>
- </div>
- </form>
-</div>
+ </form>
+ </div>
+%endif
diff -r 72daa0d41d1b -r 3914645ecccb templates/webapps/galaxy/base_panels.mako
--- a/templates/webapps/galaxy/base_panels.mako Fri Apr 02 14:34:35 2010 -0400
+++ b/templates/webapps/galaxy/base_panels.mako Fri Apr 02 15:00:53 2010 -0400
@@ -100,28 +100,26 @@
%>
<div class="submenu">
<ul class="loggedout-only" style="${style1}">
- <li><a href="${h.url_for( controller='/user', action='login' )}">Login</a></li>
+ <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='login' )}">Login</a></li>
%if app.config.allow_user_creation:
- <li><a href="${h.url_for( controller='/user', action='create' )}">Register</a></li>
+ <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='create' )}">Register</a></li>
%endif
</ul>
<ul class="loggedin-only" style="${style2}">
%if app.config.use_remote_user:
%if app.config.remote_user_logout_href:
- <li><a href="${app.config.remote_user_logout_href}" target="_top">Logout</a></li>
+ <li><a target="galaxy_main" href="${app.config.remote_user_logout_href}">Logout</a></li>
%endif
%else:
<li>Logged in as <span id="user-email">${user_email}</span></li>
<li><a target="galaxy_main" href="${h.url_for( controller='/user', action='index' )}">Preferences</a></li>
<%
if app.config.require_login:
- logout_target = ""
logout_url = h.url_for( controller='/root', action='index', m_c='user', m_a='logout' )
else:
- logout_target = ""
logout_url = h.url_for( controller='/user', action='logout' )
%>
- <li><a target="${logout_target}" href="${logout_url}">Logout</a></li>
+ <li><a target="_top" href="${logout_url}">Logout</a></li>
%endif
<li><hr style="color: inherit; background-color: gray"/></li>
<li><a target="galaxy_main" href="${h.url_for( controller='/history', action='list' )}">Histories</a></li>
diff -r 72daa0d41d1b -r 3914645ecccb test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Fri Apr 02 14:34:35 2010 -0400
+++ b/test/base/twilltestcase.py Fri Apr 02 15:00:53 2010 -0400
@@ -793,20 +793,39 @@
self.assertTrue( genome_build == dbkey )
# Functions associated with user accounts
- def create( self, email='test(a)bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy' ):
+ def create( self, email='test(a)bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy', referer='' ):
# HACK: don't use panels because late_javascripts() messes up the twill browser and it
# can't find form fields (and hence user can't be logged in).
- self.visit_url( "%s/user/create?use_panels=False&webapp=%s" % ( self.url, webapp ) )
+ self.visit_url( "%s/user/create?use_panels=False" % self.url )
tc.fv( '1', 'email', email )
+ tc.fv( '1', 'webapp', webapp )
+ tc.fv( '1', 'referer', referer )
tc.fv( '1', 'password', password )
tc.fv( '1', 'confirm', password )
tc.fv( '1', 'username', username )
tc.submit( 'create_user_button' )
- self.check_page_for_string( "now logged in as %s" % email )
- # Make sure a new private role was created for the user
- self.visit_url( "%s/user/set_default_permissions" % self.url )
- self.check_page_for_string( email )
- self.home()
+ previously_created = False
+ username_taken = False
+ invalid_username = False
+ try:
+ self.check_page_for_string( "Created new user account" )
+ except:
+ try:
+ # May have created the account in a previous test run...
+ self.check_page_for_string( "User with that email already exists" )
+ previously_created = True
+ except:
+ try:
+ self.check_page_for_string( 'This user name is not available' )
+ username_taken = True
+ except:
+ try:
+ # Note that we're only checking if the usr name is >< 4 chars here...
+ self.check_page_for_string( 'User name must be at least 4 characters in length' )
+ invalid_username = True
+ except:
+ pass
+ return previously_created, username_taken, invalid_username
def create_user_with_info( self, email, password, username, user_info_forms, user_info_form_id, user_info_values ):
'''
This method registers a new user and also provides use info
@@ -815,7 +834,6 @@
self.visit_url( "%s/user/create?user_info_select=%i&admin_view=False&use_panels=False" % ( self.url, user_info_form_id ) )
else:
self.visit_url( "%s/user/create?admin_view=False&use_panels=False" % self.url )
- ##print self.write_temp_file( self.last_page() )
self.check_page_for_string( "Create account" )
tc.fv( "1", "email", email )
tc.fv( "1", "password", password )
@@ -906,20 +924,20 @@
self.visit_url( "%s/%s" % ( self.url, url ) )
self.check_page_for_string( 'Default history permissions have been changed.' )
self.home()
- def login( self, email='test(a)bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy' ):
+ def login( self, email='test(a)bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy', referer='' ):
# test(a)bx.psu.edu is configured as an admin user
- try:
- self.create( email=email, password=password, username=username, webapp=webapp )
- except:
- self.home()
+ previously_created, username_taken, invalid_username = \
+ self.create( email=email, password=password, username=username, webapp=webapp, referer=referer )
+ if previously_created:
+ # The acount has previously been created, so just login.
# HACK: don't use panels because late_javascripts() messes up the twill browser and it
# can't find form fields (and hence user can't be logged in).
self.visit_url( "%s/user/login?use_panels=False" % self.url )
tc.fv( '1', 'email', email )
+ tc.fv( '1', 'webapp', webapp )
+ tc.fv( '1', 'referer', referer )
tc.fv( '1', 'password', password )
- tc.submit( 'Login' )
- self.check_page_for_string( "now logged in as %s" %email )
- self.home()
+ tc.submit( 'login_button' )
def logout( self ):
self.home()
self.visit_page( "user/logout" )
@@ -1161,23 +1179,41 @@
# Dataset Security stuff
# Tests associated with users
- def create_new_account_as_admin( self, email='test4(a)bx.psu.edu', password='testuser', username='regular-user4' ):
+ def create_new_account_as_admin( self, email='test4(a)bx.psu.edu', password='testuser',
+ username='regular-user4', webapp='galaxy', referer='' ):
"""Create a new account for another user"""
+ # HACK: don't use panels because late_javascripts() messes up the twill browser and it
+ # can't find form fields (and hence user can't be logged in).
self.visit_url( "%s/user/create?admin_view=True" % self.url )
tc.fv( '1', 'email', email )
+ tc.fv( '1', 'webapp', webapp )
+ tc.fv( '1', 'referer', referer )
tc.fv( '1', 'password', password )
tc.fv( '1', 'confirm', password )
tc.fv( '1', 'username', username )
tc.submit( 'create_user_button' )
+ previously_created = False
+ username_taken = False
+ invalid_username = False
try:
self.check_page_for_string( "Created new user account" )
- previously_created = False
except:
- # May have created the account in a previous test run...
- self.check_page_for_string( "User with that email already exists" )
- previously_created = True
- self.home()
- return previously_created
+ try:
+ # May have created the account in a previous test run...
+ self.check_page_for_string( "User with that email already exists" )
+ previously_created = True
+ except:
+ try:
+ self.check_page_for_string( 'This user name is not available' )
+ username_taken = True
+ except:
+ try:
+ # Note that we're only checking if the usr name is >< 4 chars here...
+ self.check_page_for_string( 'User name must be at least 4 characters in length' )
+ invalid_username = True
+ except:
+ pass
+ return previously_created, username_taken, invalid_username
def reset_password_as_admin( self, user_id, password='testreset' ):
"""Reset a user password"""
self.home()
diff -r 72daa0d41d1b -r 3914645ecccb test/functional/test_admin_features.py
--- a/test/functional/test_admin_features.py Fri Apr 02 14:34:35 2010 -0400
+++ b/test/functional/test_admin_features.py Fri Apr 02 15:00:53 2010 -0400
@@ -24,7 +24,30 @@
# Logged in as admin_user
email = 'test3(a)bx.psu.edu'
password = 'testuser'
- previously_created = self.create_new_account_as_admin( email=email, password=password, username='regular-user3' )
+ # Test setting the user name to one that is already taken. Note that the account must not exist in order
+ # for this test to work as desired, so the email we're passing is important...
+ previously_created, username_taken, invalid_username = self.create_new_account_as_admin( email='diff(a)you.com',
+ password=password,
+ username='admin-user',
+ webapp='galaxy',
+ referer='' )
+ if not username_taken:
+ raise AssertionError, "The user name (%s) is already being used by another user, but no error was displayed" \
+ % 'admin-user'
+ # Test setting the user name to an invalid one. Note that the account must not exist in order
+ # for this test to work as desired, so the email we're passing is important...
+ previously_created, username_taken, invalid_username = self.create_new_account_as_admin( email='diff(a)you.com',
+ password=password,
+ username='h',
+ webapp='galaxy',
+ referer='' )
+ if not invalid_username:
+ raise AssertionError, "The user name (%s) is is invalid, but no error was displayed" % username
+ previously_created, username_taken, invalid_username = self.create_new_account_as_admin( email=email,
+ password=password,
+ username='regular-user3',
+ webapp='galaxy',
+ referer='' )
# Get the user object for later tests
global regular_user3
regular_user3 = get_user( email )
1
0

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/72daa0d41d1b
changeset: 3603:72daa0d41d1b
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Fri Apr 02 14:34:35 2010 -0400
description:
Removed 'Shared Histories' from history options menu because it doesn't work and is redundant as users can view shared/accessible/published histories from 'Saved Histories'.
diffstat:
templates/root/index.mako | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diffs (13 lines):
diff -r b95a24c9187e -r 72daa0d41d1b templates/root/index.mako
--- a/templates/root/index.mako Fri Apr 02 14:23:55 2010 -0400
+++ b/templates/root/index.mako Fri Apr 02 14:34:35 2010 -0400
@@ -10,9 +10,6 @@
"Saved Histories": function() {
galaxy_main.location = "${h.url_for( controller='history', action='list')}";
},
- "Shared Histories": function() {
- galaxy_main.location = "${h.url_for( controller='history', action='list', operation='sharing' )}";
- },
"Histories Shared with Me": function() {
galaxy_main.location = "${h.url_for( controller='history', action='list_shared')}";
},
1
0

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/b95a24c9187e
changeset: 3602:b95a24c9187e
user: fubar: ross Lazarus at gmail period com
date: Fri Apr 02 14:23:55 2010 -0400
description:
Two small fixes for WGA/SNP tools needed so they work on test.
Remove bogus extra_ from file_path for output files - works on rgenetics.org but breaks on test - fixed
Need to create output extra_files_path in rgGRR.py
diffstat:
tools/rgenetics/rgGRR.py | 4 ++++
tools/rgenetics/rgGRR.xml | 2 +-
tools/rgenetics/rgfakePed.xml | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r 6bbe3704b015 -r b95a24c9187e tools/rgenetics/rgGRR.py
--- a/tools/rgenetics/rgGRR.py Fri Apr 02 12:24:39 2010 -0400
+++ b/tools/rgenetics/rgGRR.py Fri Apr 02 14:23:55 2010 -0400
@@ -1037,6 +1037,10 @@
basename = sys.argv[2]
outhtml = sys.argv[3]
newfilepath = sys.argv[4]
+ try:
+ os.makedirs(newfilepath)
+ except:
+ pass
title = sys.argv[5].translate(ptran)
logfname = 'Log_%s.txt' % title
logpath = os.path.join(newfilepath,logfname) # log was a child - make part of html extra_files_path zoo
diff -r 6bbe3704b015 -r b95a24c9187e tools/rgenetics/rgGRR.xml
--- a/tools/rgenetics/rgGRR.xml Fri Apr 02 12:24:39 2010 -0400
+++ b/tools/rgenetics/rgGRR.xml Fri Apr 02 14:23:55 2010 -0400
@@ -3,7 +3,7 @@
<description>Pairwise Allele Sharing</description>
<command interpreter="python">
rgGRR.py $i.extra_files_path/$i.metadata.base_name "$i.metadata.base_name"
- '$out_file1' '$out_file1.extra_files_path' "$title1" '$n' '$Z'
+ '$out_file1' '$out_file1.files_path' "$title1" '$n' '$Z'
</command>
<inputs>
<param name="i" type="data" label="Genotype data file from your current history"
diff -r 6bbe3704b015 -r b95a24c9187e tools/rgenetics/rgfakePed.xml
--- a/tools/rgenetics/rgfakePed.xml Fri Apr 02 12:24:39 2010 -0400
+++ b/tools/rgenetics/rgfakePed.xml Fri Apr 02 14:23:55 2010 -0400
@@ -2,7 +2,7 @@
<description>for testing</description>
<code file="rgfakePed_code.py"/>
<command interpreter="python">rgfakePed.py --title '$title1'
- -o '$out_file1' -p '$out_file1.extra_files_path' -c '$ncases' -n '$ntotal'
+ -o '$out_file1' -p '$out_file1.files_path' -c '$ncases' -n '$ntotal'
-s '$nsnp' -w '$lowmaf' -v '$missingValue' -l '$outFormat'
-d '$mafdist' -m '$missingRate' -M '$mendelRate' </command>
<inputs>
1
0

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/6bbe3704b015
changeset: 3601:6bbe3704b015
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Fri Apr 02 12:24:39 2010 -0400
description:
Fix value-entry bug in dbkey select input component. Bug reported by Assaf Gordon.
diffstat:
static/scripts/galaxy.base.js | 4 +++-
static/scripts/packed/galaxy.base.js | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diffs (24 lines):
diff -r 146eae852b97 -r 6bbe3704b015 static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js Fri Apr 02 11:10:23 2010 -0400
+++ b/static/scripts/galaxy.base.js Fri Apr 02 12:24:39 2010 -0400
@@ -146,9 +146,11 @@
return;
}
- // Set options and mapping.
+ // Set options and mapping. Mapping is (i) [from text to value] AND (ii) [from value to value]. This
+ // enables a user to type the value directly rather than select the text that represents the value.
dbkey_options.push( text );
dbkey_mapping[ text ] = value;
+ dbkey_mapping[ value ] = value;
// If this is the start value, set value of input element.
if ( value == start_value ) {
diff -r 146eae852b97 -r 6bbe3704b015 static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js Fri Apr 02 11:10:23 2010 -0400
+++ b/static/scripts/packed/galaxy.base.js Fri Apr 02 12:24:39 2010 -0400
@@ -1,1 +1,1 @@
-$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id"!
)+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function replace_dbkey_select(){var c=$("select[name=dbkey]");var d=c.attr("value");if(c.length!==0){var e=$("<input id='dbkey-input' type='text'></input>!
");e.attr("size",40);e.attr("name",c.attr("name"));e.click(function(){
var g=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",g);$(this).select()});var b=[];var a={};c.children("option").each(function(){var h=$(this).text();var g=$(this).attr("value");if(g=="?"){return}b.push(h);a[h]=g;if(g==d){e.attr("value",h)}});if(e.attr("value")==""){e.attr("value","Click to Search or Select Build")}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};e.autocomplete(b,f);c.replaceWith(e);$("form").submit(function(){var i=$("#dbkey-input");if(i.length!==0){var h=i.attr("value");var g=a[h];if(g!==null&&g!==undefined){i.attr("value",g)}else{if(d!=""){i.attr("value",d)}else{i.attr("value","?")}}}})}}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,!
cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
+$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id"!
)+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function replace_dbkey_select(){var c=$("select[name=dbkey]");var d=c.attr("value");if(c.length!==0){var e=$("<input id='dbkey-input' type='text'></input>!
");e.attr("size",40);e.attr("name",c.attr("name"));e.click(function(){
var g=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",g);$(this).select()});var b=[];var a={};c.children("option").each(function(){var h=$(this).text();var g=$(this).attr("value");if(g=="?"){return}b.push(h);a[h]=g;a[g]=g;if(g==d){e.attr("value",h)}});if(e.attr("value")==""){e.attr("value","Click to Search or Select Build")}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};e.autocomplete(b,f);c.replaceWith(e);$("form").submit(function(){var i=$("#dbkey-input");if(i.length!==0){var h=i.attr("value");var g=a[h];if(g!==null&&g!==undefined){i.attr("value",g)}else{if(d!=""){i.attr("value",d)}else{i.attr("value","?")}}}})}}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({!
rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
1
0

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/146eae852b97
changeset: 3600:146eae852b97
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Fri Apr 02 11:10:23 2010 -0400
description:
Make visualizations (a) importable and (b) embeddable in pages. Still need to add code for displaying visualizations in pages.
diffstat:
lib/galaxy/web/base/controller.py | 2 +-
lib/galaxy/web/controllers/page.py | 35 +++++++++++++++-
lib/galaxy/web/controllers/visualization.py | 63 ++++++++++++++++++++++++++++-
lib/galaxy/web/controllers/workflow.py | 4 -
static/june_2007_style/blue/embed_item.css | 2 +
static/june_2007_style/embed_item.css.tmpl | 10 ++++
templates/page/editor.mako | 32 ++++++++++++--
templates/visualization/embed.mako | 4 +
8 files changed, 140 insertions(+), 12 deletions(-)
diffs (337 lines):
diff -r b07142ce9dbb -r 146eae852b97 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py Thu Apr 01 22:48:57 2010 -0400
+++ b/lib/galaxy/web/base/controller.py Fri Apr 02 11:10:23 2010 -0400
@@ -178,7 +178,7 @@
if not visualization:
error( "Visualization not found" )
else:
- return self.security_check( trans.get_user(), stored, check_ownership, check_accessible )
+ return self.security_check( trans.get_user(), visualization, check_ownership, check_accessible )
class UsesStoredWorkflow( SharableItemSecurity ):
""" Mixin for controllers that use StoredWorkflow objects. """
diff -r b07142ce9dbb -r 146eae852b97 lib/galaxy/web/controllers/page.py
--- a/lib/galaxy/web/controllers/page.py Thu Apr 01 22:48:57 2010 -0400
+++ b/lib/galaxy/web/controllers/page.py Fri Apr 02 11:10:23 2010 -0400
@@ -186,6 +186,25 @@
key="free-text-search", visible=False, filterable="standard" )
)
+class VisualizationSelectionGrid( ItemSelectionGrid ):
+ """ Grid for selecting visualizations. """
+ # Grid definition.
+ title = "Saved Visualizations"
+ model_class = model.Visualization
+ columns = [
+ grids.TextColumn( "Title", key="title", model_class=model.Visualization, filterable="advanced" ),
+ grids.TextColumn( "Type", key="type", model_class=model.Visualization ),
+ grids.IndividualTagsColumn( "Tags", "tags", model.Visualization, model.VisualizationTagAssociation, filterable="advanced", grid_name="VisualizationListGrid" ),
+ grids.SharingStatusColumn( "Sharing", key="sharing", model_class=model.Visualization, filterable="advanced", sortable=False ),
+ grids.GridColumn( "Last Updated", key="update_time", format=time_ago ),
+ ]
+ columns.append(
+ grids.MulticolFilterColumn(
+ "Search",
+ cols_to_filter=[ columns[0], columns[2] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
+
class _PageContentProcessor( _BaseHTMLProcessor ):
""" Processes page content to produce HTML that is suitable for display. For now, processor renders embedded objects. """
@@ -249,7 +268,7 @@
# Default behavior:
_BaseHTMLProcessor.unknown_endtag( self, tag )
-class PageController( BaseController, Sharable, UsesAnnotations, UsesHistory, UsesStoredWorkflow, UsesHistoryDatasetAssociation ):
+class PageController( BaseController, Sharable, UsesAnnotations, UsesHistory, UsesStoredWorkflow, UsesHistoryDatasetAssociation, UsesVisualization ):
_page_list = PageListGrid()
_all_published_list = PageAllPublishedGrid()
@@ -257,6 +276,7 @@
_workflow_selection_grid = WorkflowSelectionGrid()
_datasets_selection_grid = HistoryDatasetAssociationSelectionGrid()
_page_selection_grid = PageSelectionGrid()
+ _visualization_selection_grid = VisualizationSelectionGrid()
@web.expose
@web.require_login()
@@ -626,6 +646,13 @@
return self._workflow_selection_grid( trans, **kwargs )
@web.expose
+ @web.require_login("select a visualization from saved visualizations")
+ def list_visualizations_for_selection( self, trans, **kwargs ):
+ """ Returns HTML that enables a user to select one or more visualizations. """
+ # Render the list view
+ return self._visualization_selection_grid( trans, **kwargs )
+
+ @web.expose
@web.require_login("select a page from saved pages")
def list_pages_for_selection( self, trans, **kwargs ):
""" Returns HTML that enables a user to select one or more pages. """
@@ -685,6 +712,12 @@
if workflow:
self.get_stored_workflow_steps( trans, workflow )
return trans.fill_template( "workflow/embed.mako", item=workflow, item_data=workflow.latest_workflow.steps )
+ elif item_class == model.Visualization:
+ visualization = self.get_visualization( trans, item_id, False, True )
+ visualization.annotation = self.get_item_annotation_str( trans.sa_session, visualization.user, visualization )
+ if visualization:
+ return trans.fill_template( "visualization/embed.mako", item=visualization, item_data=None )
+
elif item_class == model.Page:
pass
diff -r b07142ce9dbb -r 146eae852b97 lib/galaxy/web/controllers/visualization.py
--- a/lib/galaxy/web/controllers/visualization.py Thu Apr 01 22:48:57 2010 -0400
+++ b/lib/galaxy/web/controllers/visualization.py Fri Apr 02 11:10:23 2010 -0400
@@ -73,6 +73,12 @@
else:
# Render grid wrapped in panels
return trans.fill_template( "visualization/list_published.mako", grid=grid )
+
+ @web.expose
+ @web.require_login( "use Galaxy visualizations", use_panels=True )
+ def index( self, trans, *args, **kwargs ):
+ """ Lists user's saved visualizations. """
+ return self.list( trans, args, kwargs )
@web.expose
@web.require_login( "use Galaxy visualizations", use_panels=True )
@@ -110,6 +116,61 @@
visualization.slug = new_slug
trans.sa_session.flush()
return visualization.slug
+
+ @web.expose
+ @web.require_login( "use Galaxy visualizations" )
+ def set_accessible_async( self, trans, id=None, accessible=False ):
+ """ Set visualization's importable attribute and slug. """
+ visualization = self.get_visualization( trans, id )
+
+ # Only set if importable value would change; this prevents a change in the update_time unless attribute really changed.
+ importable = accessible in ['True', 'true', 't', 'T'];
+ if visualization and visualization.importable != importable:
+ if importable:
+ self._make_item_accessible( trans.sa_session, visualization )
+ else:
+ visualization.importable = importable
+ trans.sa_session.flush()
+
+ return
+
+ @web.expose
+ @web.require_login( "share Galaxy visualizations" )
+ def imp( self, trans, id ):
+ """ Import a visualization into user's workspace. """
+ # Set referer message.
+ referer = trans.request.referer
+ if referer is not "":
+ referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ else:
+ referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' )
+
+ # Do import.
+ session = trans.sa_session
+ visualization = self.get_visualization( trans, id, check_ownership=False )
+ if visualization.importable == False:
+ return trans.show_error_message( "The owner of this visualization has disabled imports via this link.<br>You can %s" % referer_message, use_panels=True )
+ elif visualization.user == trans.user:
+ return trans.show_error_message( "You can't import this visualization because you own it.<br>You can %s" % referer_message, use_panels=True )
+ elif visualization.deleted:
+ return trans.show_error_message( "You can't import this visualization because it has been deleted.<br>You can %s" % referer_message, use_panels=True )
+ else:
+ # Create imported visualization via copy. TODO: Visualizations use datasets -- do we need to check to ensure that
+ # datasets can be imported/viewed and/or copy datasets to user?
+ imported_visualization = model.Visualization()
+ imported_visualization.title = "imported: " + visualization.title
+ imported_visualization.latest_revision = visualization.latest_revision
+ imported_visualization.user = trans.user
+ # Save new visualization.
+ session = trans.sa_session
+ session.add( imported_visualization )
+ session.flush()
+
+ # Redirect to load galaxy frames.
+ return trans.show_ok_message(
+ message="""Visualization "%s" has been imported. <br>You can <a href="%s">start using this visualization</a> or %s."""
+ % ( visualization.title, web.url_for( controller='visualization' ), referer_message ), use_panels=True )
+
@web.expose
@web.require_login( "share Galaxy visualizations" )
@@ -214,7 +275,7 @@
@web.require_login("get item content asynchronously")
def get_item_content_async( self, trans, id ):
""" Returns item content in HTML format. """
- pass
+ return "TODO: visualization content"
@web.expose
@web.require_login( "create visualizations" )
diff -r b07142ce9dbb -r 146eae852b97 lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py Thu Apr 01 22:48:57 2010 -0400
+++ b/lib/galaxy/web/controllers/workflow.py Fri Apr 02 11:10:23 2010 -0400
@@ -294,10 +294,6 @@
return trans.show_error_message( "You can't import this workflow because you own it.<br>You can %s" % referer_message, use_panels=True )
elif stored.deleted:
return trans.show_error_message( "You can't import this workflow because it has been deleted.<br>You can %s" % referer_message, use_panels=True )
- elif session.query( model.StoredWorkflowUserShareAssociation ) \
- .filter_by( user=trans.user, stored_workflow=stored ).count() > 0:
- # TODO: this is only reasonable as long as import creates a sharing relation.
- return trans.show_error_message( "You can't import this workflow because it is already shared with you.<br>You can %s" % referer_message, use_panels=True )
else:
# Create imported workflow via copy.
imported_stored = model.StoredWorkflow()
diff -r b07142ce9dbb -r 146eae852b97 static/june_2007_style/blue/embed_item.css
--- a/static/june_2007_style/blue/embed_item.css Thu Apr 01 22:48:57 2010 -0400
+++ b/static/june_2007_style/blue/embed_item.css Fri Apr 02 11:10:23 2010 -0400
@@ -6,6 +6,8 @@
.embedded-item.dataset p{background:#CFC no-repeat 2px 2px;margin-top:0;margin-bottom:0;}
.embedded-item.workflow{background-color:#FBDDB3}
.embedded-item.workflow p{background:#FBDDB3 no-repeat 2px 2px;margin-top:0;margin-bottom:0;}
+.embedded-item.visualization{background-color:#BBBBBB}
+.embedded-item.visualization p{background:#BBBBBB no-repeat 2px 2px;margin-top:0;margin-bottom:0;}
.embedded-item.placeholder{}
.embedded-item .item-content{max-height:25em;overflow:auto;display:none;}
.embedded-item .title{vertical-align:top;text-align:center;font-weight:bold;}
diff -r b07142ce9dbb -r 146eae852b97 static/june_2007_style/embed_item.css.tmpl
--- a/static/june_2007_style/embed_item.css.tmpl Thu Apr 01 22:48:57 2010 -0400
+++ b/static/june_2007_style/embed_item.css.tmpl Fri Apr 02 11:10:23 2010 -0400
@@ -41,6 +41,16 @@
margin-bottom:0;
}
+.embedded-item.visualization {
+ background-color:#BBBBBB
+}
+
+.embedded-item.visualization p {
+ background:#BBBBBB no-repeat 2px 2px;
+ margin-top:0;
+ margin-bottom:0;
+}
+
.embedded-item.placeholder{}
.embedded-item .item-content {
diff -r b07142ce9dbb -r 146eae852b97 templates/page/editor.mako
--- a/templates/page/editor.mako Thu Apr 01 22:48:57 2010 -0400
+++ b/templates/page/editor.mako Fri Apr 02 11:10:23 2010 -0400
@@ -34,18 +34,21 @@
ITEM_DATASET : "item_dataset",
ITEM_WORKFLOW : "item_workflow",
ITEM_PAGE : "item_page",
+ ITEM_VISUALIZATION : "item_visualization",
// Link dialogs.
DIALOG_HISTORY_LINK : "link_history",
DIALOG_DATASET_LINK : "link_dataset",
DIALOG_WORKFLOW_LINK : "link_workflow",
DIALOG_PAGE_LINK : "link_page",
+ DIALOG_VISUALIZATION_LINK : "link_visualization",
// Embed dialogs.
DIALOG_EMBED_HISTORY : "embed_history",
DIALOG_EMBED_DATASET : "embed_dataset",
DIALOG_EMBED_WORKFLOW : "embed_workflow",
DIALOG_EMBED_PAGE : "embed_page",
+ DIALOG_EMBED_VISUALIZATION : "embed_visualization",
// Annotation dialogs.
DIALOG_HISTORY_ANNOTATE : "history_annotate",
@@ -101,6 +104,11 @@
item_plural = "Pages";
item_controller = "page";
item_class = "Page";
+ case( Galaxy.ITEM_VISUALIZATION ):
+ item_singular = "Visualization";
+ item_plural = "Visualizations";
+ item_controller = "visualization";
+ item_class = "Visualization";
break;
}
@@ -316,9 +324,10 @@
);
}
- // INSERT "GALAXY ITEM" (HISTORY, DATASET, WORKFLOW, PAGE) LINK DIALOG
+ // INSERT "GALAXY ITEM" LINK DIALOG
if ( dialogType == Galaxy.DIALOG_HISTORY_LINK || dialogType == Galaxy.DIALOG_DATASET_LINK ||
- dialogType == Galaxy.DIALOG_WORKFLOW_LINK || dialogType == Galaxy.DIALOG_PAGE_LINK ) {
+ dialogType == Galaxy.DIALOG_WORKFLOW_LINK || dialogType == Galaxy.DIALOG_PAGE_LINK ||
+ dialogType == Galaxy.DIALOG_VISUALIZATION_LINK ) {
// Based on item type, set useful vars.
var item_info;
switch(dialogType)
@@ -335,6 +344,9 @@
case(Galaxy.DIALOG_PAGE_LINK):
item_info = get_item_info(Galaxy.ITEM_PAGE);
break;
+ case(Galaxy.DIALOG_VISUALIZATION_LINK):
+ item_info = get_item_info(Galaxy.ITEM_VISUALIZATION);
+ break;
}
$.ajax(
@@ -405,7 +417,7 @@
});
}
// EMBED GALAXY OBJECT DIALOGS
- if ( dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_DATASET || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW || dialogType == Galaxy.DIALOG_EMBED_PAGE ) {
+ if ( dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_DATASET || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW || dialogType == Galaxy.DIALOG_EMBED_PAGE || dialogType == Galaxy.DIALOG_EMBED_VISUALIZATION ) {
// Based on item type, set useful vars.
var item_info;
switch(dialogType)
@@ -422,6 +434,9 @@
case(Galaxy.DIALOG_EMBED_PAGE):
item_info = get_item_info(Galaxy.ITEM_PAGE);
break;
+ case(Galaxy.DIALOG_EMBED_VISUALIZATION):
+ item_info = get_item_info(Galaxy.ITEM_VISUALIZATION);
+ break;
}
$.ajax(
@@ -432,7 +447,8 @@
success: function(list_html)
{
// Can make histories, workflows importable; cannot make datasets importable.
- if (dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW)
+ if (dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW
+ || dialogType == Galaxy.DIALOG_EMBED_VISUALIZATION)
list_html = list_html + "<div><input id='make-importable' type='checkbox' checked/>" +
"Make the selected " + item_info.plural.toLowerCase() + " accessible so that they can viewed by everyone.</div>";
show_modal(
@@ -687,7 +703,10 @@
},
"Insert Page Link": function() {
editor.dialog(Galaxy.DIALOG_PAGE_LINK);
- }
+ },
+ "Insert Visualization Link": function() {
+ editor.dialog(Galaxy.DIALOG_VISUALIZATION_LINK);
+ },
});
//
@@ -709,6 +728,9 @@
"Embed Workflow": function() {
editor.dialog(Galaxy.DIALOG_EMBED_WORKFLOW);
},
+ "Embed Visualization": function() {
+ editor.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION);
+ },
##"Embed Page": function() {
## editor.dialog(Galaxy.DIALOG_EMBED_PAGE);
##}
diff -r b07142ce9dbb -r 146eae852b97 templates/visualization/embed.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/visualization/embed.mako Fri Apr 02 11:10:23 2010 -0400
@@ -0,0 +1,4 @@
+<%inherit file="/embed_base.mako"/>
+
+<%def name="render_summary_content( workflow, steps )">
+</%def>
1
0

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/b07142ce9dbb
changeset: 3599:b07142ce9dbb
user: Kanwei Li <kanwei(a)gmail.com>
date: Thu Apr 01 22:48:57 2010 -0400
description:
New tool to select N random lines from a file/dataset. Closes #238
diffstat:
tool_conf.xml.sample | 1 +
tools/filters/randomlines.py | 33 +++++++++++++++++++++++++++++++++
tools/filters/randomlines.xml | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 0 deletions(-)
diffs (94 lines):
diff -r 9f7d7e900cdf -r b07142ce9dbb tool_conf.xml.sample
--- a/tool_conf.xml.sample Thu Apr 01 20:36:31 2010 -0400
+++ b/tool_conf.xml.sample Thu Apr 01 22:48:57 2010 -0400
@@ -46,6 +46,7 @@
<tool file="filters/changeCase.xml" />
<tool file="filters/pasteWrapper.xml" />
<tool file="filters/remove_beginning.xml" />
+ <tool file="filters/randomlines.xml" />
<tool file="filters/headWrapper.xml" />
<tool file="filters/tailWrapper.xml" />
<tool file="filters/trimmer.xml" />
diff -r 9f7d7e900cdf -r b07142ce9dbb tools/filters/randomlines.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/filters/randomlines.py Thu Apr 01 22:48:57 2010 -0400
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+# Kanwei Li, 2010
+# Selects N random lines from a file and outputs to another file
+
+import random, sys
+
+def main():
+ infile = open(sys.argv[1], 'r')
+ total_lines = int(sys.argv[2])
+
+ if total_lines < 1:
+ sys.stderr.write( "Must select at least one line." )
+ sys.exit()
+
+ kept = []
+ n = 0
+ for line in infile:
+ line = line.rstrip("\n")
+ n += 1
+ if (n <= total_lines):
+ kept.append(line)
+ elif random.randint(1, n) <= total_lines:
+ kept.pop(random.randint(0, total_lines-1))
+ kept.append(line)
+
+ if n < total_lines:
+ sys.stderr.write( "Error: asked to select more lines than there were in the file." )
+ sys.exit()
+
+ open(sys.argv[3], 'w').write( "\n".join(kept) )
+
+if __name__ == "__main__":
+ main()
diff -r 9f7d7e900cdf -r b07142ce9dbb tools/filters/randomlines.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/filters/randomlines.xml Thu Apr 01 22:48:57 2010 -0400
@@ -0,0 +1,42 @@
+<tool id="random_lines1" name="Select random lines">
+ <description>from a file</description>
+ <command interpreter="python">randomlines.py $input $num_lines $out_file1</command>
+ <inputs>
+ <param name="num_lines" size="5" type="integer" value="1" label="Randomly select" help="lines"/>
+ <param format="txt" name="input" type="data" label="from"/>
+ </inputs>
+ <outputs>
+ <data format="input" name="out_file1" metadata_source="input"/>
+ </outputs>
+ <tests>
+ <test>
+ <param name="num_lines" value="65"/>
+ <param name="input" value="1.bed"/>
+ <output name="out_file1" file="1.bed"/>
+ </test>
+ </tests>
+ <help>
+
+**What it does**
+
+This tool selects N random lines from a file, with no repeats, and preserving ordering.
+
+-----
+
+**Example**
+
+Input File::
+
+ chr7 56632 56652 D17003_CTCF_R6 310 +
+ chr7 56736 56756 D17003_CTCF_R7 354 +
+ chr7 56761 56781 D17003_CTCF_R4 220 +
+ chr7 56772 56792 D17003_CTCF_R7 372 +
+ chr7 56775 56795 D17003_CTCF_R4 207 +
+
+Selecting 2 random lines might return this::
+
+ chr7 56736 56756 D17003_CTCF_R7 354 +
+ chr7 56775 56795 D17003_CTCF_R4 207 +
+
+ </help>
+</tool>
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/9f7d7e900cdf
changeset: 3598:9f7d7e900cdf
user: Kanwei Li <kanwei(a)gmail.com>
date: Thu Apr 01 20:36:31 2010 -0400
description:
Sync hashbangs
diffstat:
lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py | 2 +-
lib/galaxy/datatypes/converters/fastqsolexa_to_fasta_converter.py | 2 +-
lib/galaxy/datatypes/converters/fastqsolexa_to_qual_converter.py | 2 +-
scripts/check_eggs.py | 2 +-
scripts/galaxy_messaging/server/daemon.py | 2 +-
scripts/galaxy_messaging/server/data_transfer.py | 2 +-
scripts/metagenomics/convert_title.py | 2 +-
scripts/tools/re_escape_output.py | 2 +-
tools/fasta_tools/fasta_compute_length.py | 2 +-
tools/fasta_tools/fasta_concatenate_by_species.py | 2 +-
tools/fasta_tools/fasta_filter_by_length.py | 2 +-
tools/fasta_tools/fasta_to_tabular.py | 2 +-
tools/metag_tools/blat_coverage_report.py | 2 +-
tools/metag_tools/blat_mapping.py | 2 +-
tools/metag_tools/blat_wrapper.py | 2 +-
tools/metag_tools/convert_SOLiD_color2nuc.py | 2 +-
tools/metag_tools/fastqsolexa_to_fasta_qual.py | 2 +-
tools/metag_tools/mapping_to_ucsc.py | 2 +-
tools/metag_tools/megablast_wrapper.py | 2 +-
tools/metag_tools/megablast_xml_parser.py | 2 +-
tools/metag_tools/rmap_wrapper.py | 2 +-
tools/metag_tools/rmapq_wrapper.py | 2 +-
tools/metag_tools/short_reads_figure_high_quality_length.py | 2 +-
tools/metag_tools/short_reads_figure_score.py | 2 +-
tools/metag_tools/short_reads_trim_seq.py | 2 +-
tools/metag_tools/shrimp_color_wrapper.py | 2 +-
tools/metag_tools/shrimp_wrapper.py | 2 +-
tools/metag_tools/split_paired_reads.py | 2 +-
tools/new_operations/get_flanks.py | 2 +-
tools/next_gen_conversion/fastq_conversions.py | 2 +-
tools/next_gen_conversion/solid_to_fastq.py | 2 +-
tools/regVariation/getIndels.py | 2 +-
tools/regVariation/maf_cpg_filter.py | 2 +-
tools/regVariation/quality_filter.py | 2 +-
tools/regVariation/substitution_rates.py | 2 +-
tools/regVariation/substitutions.py | 2 +-
tools/regVariation/windowSplitter.py | 2 +-
tools/samtools/pileup_interval.py | 2 +-
tools/samtools/sam_merge.py | 2 +-
tools/samtools/sam_pileup.py | 2 +-
tools/samtools/sam_to_bam.py | 2 +-
tools/solid_tools/maq_cs_wrapper.py | 2 +-
tools/solid_tools/solid_qual_stats.py | 2 +-
tools/sr_mapping/bowtie_wrapper.py | 2 +-
tools/sr_mapping/bwa_wrapper.py | 2 +-
tools/sr_mapping/lastz_paired_reads_wrapper.py | 2 +-
tools/sr_mapping/lastz_wrapper.py | 2 +-
tools/stats/gsummary.py | 2 +-
tools/tophat/tophat_wrapper.py | 2 +-
49 files changed, 49 insertions(+), 49 deletions(-)
diffs (441 lines):
diff -r 8457a6f3214a -r 9f7d7e900cdf lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py
--- a/lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py Thu Apr 01 16:02:19 2010 -0400
+++ b/lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
# This code exists in 2 places: ~/datatypes/converters and ~/tools/fasta_tools
"""
Input: fasta, minimal length, maximal length
diff -r 8457a6f3214a -r 9f7d7e900cdf lib/galaxy/datatypes/converters/fastqsolexa_to_fasta_converter.py
--- a/lib/galaxy/datatypes/converters/fastqsolexa_to_fasta_converter.py Thu Apr 01 16:02:19 2010 -0400
+++ b/lib/galaxy/datatypes/converters/fastqsolexa_to_fasta_converter.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
convert fastqsolexa file to separated sequence and quality files.
diff -r 8457a6f3214a -r 9f7d7e900cdf lib/galaxy/datatypes/converters/fastqsolexa_to_qual_converter.py
--- a/lib/galaxy/datatypes/converters/fastqsolexa_to_qual_converter.py Thu Apr 01 16:02:19 2010 -0400
+++ b/lib/galaxy/datatypes/converters/fastqsolexa_to_qual_converter.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
convert fastqsolexa file to separated sequence and quality files.
diff -r 8457a6f3214a -r 9f7d7e900cdf scripts/check_eggs.py
--- a/scripts/check_eggs.py Thu Apr 01 16:02:19 2010 -0400
+++ b/scripts/check_eggs.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
usage: check_eggs.py
"""
diff -r 8457a6f3214a -r 9f7d7e900cdf scripts/galaxy_messaging/server/daemon.py
--- a/scripts/galaxy_messaging/server/daemon.py Thu Apr 01 16:02:19 2010 -0400
+++ b/scripts/galaxy_messaging/server/daemon.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""
Data Transfer Script Daemon
diff -r 8457a6f3214a -r 9f7d7e900cdf scripts/galaxy_messaging/server/data_transfer.py
--- a/scripts/galaxy_messaging/server/data_transfer.py Thu Apr 01 16:02:19 2010 -0400
+++ b/scripts/galaxy_messaging/server/data_transfer.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""
Data Transfer Script: Sequencer to Galaxy
diff -r 8457a6f3214a -r 9f7d7e900cdf scripts/metagenomics/convert_title.py
--- a/scripts/metagenomics/convert_title.py Thu Apr 01 16:02:19 2010 -0400
+++ b/scripts/metagenomics/convert_title.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
convert nt and wgs data (fasta format) to giNumber_seqLen
diff -r 8457a6f3214a -r 9f7d7e900cdf scripts/tools/re_escape_output.py
--- a/scripts/tools/re_escape_output.py Thu Apr 01 16:02:19 2010 -0400
+++ b/scripts/tools/re_escape_output.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Escapes a file into a form suitable for use with tool tests using re_match or re_match_multiline (when -m/--multiline option is used)
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/fasta_tools/fasta_compute_length.py
--- a/tools/fasta_tools/fasta_compute_length.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/fasta_tools/fasta_compute_length.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Input: fasta, int
Output: tabular
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/fasta_tools/fasta_concatenate_by_species.py
--- a/tools/fasta_tools/fasta_concatenate_by_species.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/fasta_tools/fasta_concatenate_by_species.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
#Dan Blankenberg
"""
Takes a Multiple Alignment FASTA file and concatenates
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/fasta_tools/fasta_filter_by_length.py
--- a/tools/fasta_tools/fasta_filter_by_length.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/fasta_tools/fasta_filter_by_length.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Input: fasta, minimal length, maximal length
Output: fasta
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/fasta_tools/fasta_to_tabular.py
--- a/tools/fasta_tools/fasta_to_tabular.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/fasta_tools/fasta_to_tabular.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
# This code exists in 2 places: ~/datatypes/converters and ~/tools/fasta_tools
"""
Input: fasta, int
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/blat_coverage_report.py
--- a/tools/metag_tools/blat_coverage_report.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/blat_coverage_report.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import os, sys
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/blat_mapping.py
--- a/tools/metag_tools/blat_mapping.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/blat_mapping.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import os, sys
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/blat_wrapper.py
--- a/tools/metag_tools/blat_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/blat_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import os, sys, tempfile
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/convert_SOLiD_color2nuc.py
--- a/tools/metag_tools/convert_SOLiD_color2nuc.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/convert_SOLiD_color2nuc.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
convert SOLiD calor-base data to nucleotide sequence
example: T011213122200221123032111221021210131332222101
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/fastqsolexa_to_fasta_qual.py
--- a/tools/metag_tools/fastqsolexa_to_fasta_qual.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/fastqsolexa_to_fasta_qual.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
convert fastqsolexa file to separated sequence and quality files.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/mapping_to_ucsc.py
--- a/tools/metag_tools/mapping_to_ucsc.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/mapping_to_ucsc.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
from galaxy import eggs
import sys, tempfile, os
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/megablast_wrapper.py
--- a/tools/metag_tools/megablast_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/megablast_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
run megablast for metagenomics data
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/megablast_xml_parser.py
--- a/tools/metag_tools/megablast_xml_parser.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/megablast_xml_parser.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import sys, os, re
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/rmap_wrapper.py
--- a/tools/metag_tools/rmap_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/rmap_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import os, sys, tempfile
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/rmapq_wrapper.py
--- a/tools/metag_tools/rmapq_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/rmapq_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import os, sys, tempfile
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/short_reads_figure_high_quality_length.py
--- a/tools/metag_tools/short_reads_figure_high_quality_length.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/short_reads_figure_high_quality_length.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import os, sys, math, tempfile, zipfile, re
from rpy import *
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/short_reads_figure_score.py
--- a/tools/metag_tools/short_reads_figure_score.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/short_reads_figure_score.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
boxplot:
- box: first quartile and third quartile
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/short_reads_trim_seq.py
--- a/tools/metag_tools/short_reads_trim_seq.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/short_reads_trim_seq.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
trim reads based on the quality scores
input: read file and quality score file
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/shrimp_color_wrapper.py
--- a/tools/metag_tools/shrimp_color_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/shrimp_color_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
SHRiMP wrapper : Color space
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/shrimp_wrapper.py
--- a/tools/metag_tools/shrimp_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/shrimp_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
TODO
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/metag_tools/split_paired_reads.py
--- a/tools/metag_tools/split_paired_reads.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/metag_tools/split_paired_reads.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Split fixed length paired end reads
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/new_operations/get_flanks.py
--- a/tools/new_operations/get_flanks.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/new_operations/get_flanks.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
#Done by: Guru
"""
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/next_gen_conversion/fastq_conversions.py
--- a/tools/next_gen_conversion/fastq_conversions.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/next_gen_conversion/fastq_conversions.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Performs various conversions around Sanger FASTQ data
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/next_gen_conversion/solid_to_fastq.py
--- a/tools/next_gen_conversion/solid_to_fastq.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/next_gen_conversion/solid_to_fastq.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Converts SOLiD data to Sanger FASTQ format.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/regVariation/getIndels.py
--- a/tools/regVariation/getIndels.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/regVariation/getIndels.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""
Estimate INDELs for pair-wise alignments.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/regVariation/maf_cpg_filter.py
--- a/tools/regVariation/maf_cpg_filter.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/regVariation/maf_cpg_filter.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
#Guruprasad Ananda
#Adapted from bx/scripts/maf_mask_cpg.py
"""
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/regVariation/quality_filter.py
--- a/tools/regVariation/quality_filter.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/regVariation/quality_filter.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
#Guruprasad Ananda
"""
Filter based on nucleotide quality (PHRED score).
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/regVariation/substitution_rates.py
--- a/tools/regVariation/substitution_rates.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/regVariation/substitution_rates.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
#guruprasad Ananda
"""
Estimates substitution rates from pairwise alignments using JC69 model.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/regVariation/substitutions.py
--- a/tools/regVariation/substitutions.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/regVariation/substitutions.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
#Guruprasad ANanda
"""
Fetches substitutions from pairwise alignments.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/regVariation/windowSplitter.py
--- a/tools/regVariation/windowSplitter.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/regVariation/windowSplitter.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Split into windows.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/samtools/pileup_interval.py
--- a/tools/samtools/pileup_interval.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/samtools/pileup_interval.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Condenses pileup format into ranges of bases.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/samtools/sam_merge.py
--- a/tools/samtools/sam_merge.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/samtools/sam_merge.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Merges any number of BAM files
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/samtools/sam_pileup.py
--- a/tools/samtools/sam_pileup.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/samtools/sam_pileup.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Creates a pileup file from a bam file and a reference.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/samtools/sam_to_bam.py
--- a/tools/samtools/sam_to_bam.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/samtools/sam_to_bam.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Converts SAM data to sorted BAM data.
usage: sam_to_bam.py [options]
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/solid_tools/maq_cs_wrapper.py
--- a/tools/solid_tools/maq_cs_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/solid_tools/maq_cs_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
#Guruprasad Ananda
#MAQ mapper for SOLiD colourspace-reads
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/solid_tools/solid_qual_stats.py
--- a/tools/solid_tools/solid_qual_stats.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/solid_tools/solid_qual_stats.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
#Guruprasad Ananda
import sys, os, zipfile, tempfile
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/sr_mapping/bowtie_wrapper.py
--- a/tools/sr_mapping/bowtie_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/sr_mapping/bowtie_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Runs Bowtie on single-end or paired-end data.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/sr_mapping/bwa_wrapper.py
--- a/tools/sr_mapping/bwa_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/sr_mapping/bwa_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Runs BWA on single-end or paired-end data.
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/sr_mapping/lastz_paired_reads_wrapper.py
--- a/tools/sr_mapping/lastz_paired_reads_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/sr_mapping/lastz_paired_reads_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Runs Lastz paired read alignment process
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/sr_mapping/lastz_wrapper.py
--- a/tools/sr_mapping/lastz_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/sr_mapping/lastz_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
"""
Runs Lastz
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/stats/gsummary.py
--- a/tools/stats/gsummary.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/stats/gsummary.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
import sys, re, tempfile
from rpy import *
diff -r 8457a6f3214a -r 9f7d7e900cdf tools/tophat/tophat_wrapper.py
--- a/tools/tophat/tophat_wrapper.py Thu Apr 01 16:02:19 2010 -0400
+++ b/tools/tophat/tophat_wrapper.py Thu Apr 01 20:36:31 2010 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python
import optparse, os, shutil, sys, tempfile
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/8457a6f3214a
changeset: 3597:8457a6f3214a
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Thu Apr 01 16:02:19 2010 -0400
description:
Fix workflow annotation bug.
diffstat:
lib/galaxy/web/controllers/workflow.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (16 lines):
diff -r 9c1a0eeac431 -r 8457a6f3214a lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py Thu Apr 01 15:10:45 2010 -0400
+++ b/lib/galaxy/web/controllers/workflow.py Thu Apr 01 16:02:19 2010 -0400
@@ -665,8 +665,10 @@
step.temp_input_connections = step_dict['input_connections']
# Save step annotation.
- annotation = sanitize_html( step_dict[ 'annotation' ], 'utf-8', 'text/html' )
- self.add_item_annotation( trans, step, annotation )
+ annotation = step_dict[ 'annotation' ]
+ if annotation:
+ annotation = sanitize_html( annotation, 'utf-8', 'text/html' )
+ self.add_item_annotation( trans, step, annotation )
# Second pass to deal with connections between steps
for step in steps:
# Input connections
1
0

16 Apr '10
details: http://www.bx.psu.edu/hg/galaxy/rev/9c1a0eeac431
changeset: 3596:9c1a0eeac431
user: rc
date: Thu Apr 01 15:10:45 2010 -0400
description:
lims: sample form defs dont include field type: addressfield & textarea
diffstat:
lib/galaxy/web/controllers/forms.py | 46 +++++++++++++++++++++++++-----------
lib/galaxy/web/form_builder.py | 11 ++++----
2 files changed, 37 insertions(+), 20 deletions(-)
diffs (120 lines):
diff -r 0998e47bb63c -r 9c1a0eeac431 lib/galaxy/web/controllers/forms.py
--- a/lib/galaxy/web/controllers/forms.py Thu Apr 01 14:46:41 2010 -0400
+++ b/lib/galaxy/web/controllers/forms.py Thu Apr 01 15:10:45 2010 -0400
@@ -521,7 +521,7 @@
return fd, msg
class FieldUI(object):
- def __init__(self, layout_grids, index, field=None, field_type=None):
+ def __init__(self, trans, layout_grids, index, field=None, field_type=None, form_type=None):
'''
This method returns a list of widgets which describes a field. This
includes label, helptext, type, & required/optional
@@ -533,8 +533,15 @@
refresh_on_change=True,
refresh_on_change_values=['SelectField'])
self.selectbox_options = []
- for ft in BaseField.form_field_types():
- self.fieldtype.add_option(ft, ft)
+ # if the form is for defining samples, then use the sample field types
+ # which does not include TextArea & AddressField
+ print >> sys.stderr, 'form_type', form_type
+ if form_type == trans.app.model.FormDefinition.types.SAMPLE:
+ for ft in BaseField.sample_field_types():
+ self.fieldtype.add_option(ft, ft)
+ else:
+ for ft in BaseField.form_field_types():
+ self.fieldtype.add_option(ft, ft)
self.required = SelectField('field_required_'+str(index), display='radio')
self.required.add_option('Required', 'required')
self.required.add_option('Optional', 'optional', selected=True)
@@ -544,8 +551,8 @@
for index, grid_name in enumerate(layout_grids):
self.layout_selectbox.add_option("%i. %s" %(index+1, grid_name), index)
if field:
- self.fill(field, field_type)
- def fill(self, field, field_type=None):
+ self.fill(trans, field, field_type, form_type)
+ def fill(self, trans, field, field_type=None, form_type=None):
# label
self.label.value = field['label']
# helptext
@@ -558,13 +565,24 @@
field['type'] = unicode(field_type)
if field_type == 'SelectField' and not field['selectlist']:
field['selectlist'] = ['', '']
- for ft in BaseField.form_field_types():
- if ft == field['type']:
- self.fieldtype.add_option(ft, ft, selected=True)
- if ft == 'SelectField':
- self.selectbox_ui(field)
- else:
- self.fieldtype.add_option(ft, ft)
+ # if the form is for defining samples, then use the sample field types
+ # which does not include TextArea & AddressField
+ if form_type == trans.app.model.FormDefinition.types.SAMPLE:
+ for ft in BaseField.sample_field_types():
+ if ft == field['type']:
+ self.fieldtype.add_option(ft, ft, selected=True)
+ if ft == 'SelectField':
+ self.selectbox_ui(field)
+ else:
+ self.fieldtype.add_option(ft, ft)
+ else:
+ for ft in BaseField.form_field_types():
+ if ft == field['type']:
+ self.fieldtype.add_option(ft, ft, selected=True)
+ if ft == 'SelectField':
+ self.selectbox_ui(field)
+ else:
+ self.fieldtype.add_option(ft, ft)
# required/optional
if field['required'] == 'required':
self.required = SelectField('field_required_'+str(self.index), display='radio')
@@ -623,9 +641,9 @@
field_details = []
for index, field in enumerate( current_form[ 'fields' ] ):
if current_form['type'] == trans.app.model.FormDefinition.types.SAMPLE:
- field_ui = self.FieldUI( current_form['layout'], index, field )
+ field_ui = self.FieldUI( trans, current_form['layout'], index, field, form_type=current_form['type'] )
else:
- field_ui = self.FieldUI( None, index, field )
+ field_ui = self.FieldUI( trans, None, index, field, form_type=current_form['type'] )
field_details.append( field_ui.get() )
return trans.fill_template( '/admin/forms/edit_form.mako',
form_details=form_details,
diff -r 0998e47bb63c -r 9c1a0eeac431 lib/galaxy/web/form_builder.py
--- a/lib/galaxy/web/form_builder.py Thu Apr 01 14:46:41 2010 -0400
+++ b/lib/galaxy/web/form_builder.py Thu Apr 01 15:10:45 2010 -0400
@@ -13,6 +13,10 @@
@staticmethod
def form_field_types():
return ['TextField', 'TextArea', 'SelectField', 'CheckboxField', 'AddressField', 'WorkflowField']
+ @staticmethod
+ def sample_field_types():
+ return ['TextField', 'SelectField', 'CheckboxField', 'WorkflowField']
+
class TextField(BaseField):
"""
@@ -443,11 +447,6 @@
self.select_workflow = None
self.params = params
def get_html(self):
- from galaxy import util
- add_ids = ['none']
- if self.user:
- for a in self.user.stored_workflows:
- add_ids.append(str(a.id))
self.select_workflow = SelectField(self.name)
if self.value == 'none':
self.select_workflow.add_option('Select one', 'none', selected=True)
@@ -456,7 +455,7 @@
if self.user:
for a in self.user.stored_workflows:
if not a.deleted:
- if self.value == str(a.id):
+ if str(self.value) == str(a.id):
self.select_workflow.add_option(a.name, str(a.id), selected=True)
else:
self.select_workflow.add_option(a.name, str(a.id))
1
0