Skip to content

Commit

Permalink
Merge branch '4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
remkonoteboom committed Feb 23, 2016
2 parents c564f2e + 9028912 commit b9047e0
Show file tree
Hide file tree
Showing 159 changed files with 7,767 additions and 6,264 deletions.
18 changes: 15 additions & 3 deletions src/bin/startup_queue.py
Expand Up @@ -18,10 +18,10 @@

import time

def main():
def main(site=None):
#print "Starting Job Queue ..."
from pyasm.security import Batch
Batch()
Batch(site=site)

JobTask.start(
check_interval=0.1,
Expand All @@ -38,5 +38,17 @@ def main():

if __name__ == '__main__':

main()
from optparse import OptionParser


parser = OptionParser()
parser.add_option("-s", "--site", dest="site", help="Site to grab queue from")

(options, args) = parser.parse_args()

if len(args) == 1:
site = args[0]
else:
site = options.site

main(site=site)
48 changes: 46 additions & 2 deletions src/client/tactic_client_lib/tactic_server_stub.py
Expand Up @@ -672,6 +672,34 @@ def get_connection_info(my):
return my.server.get_connection_info(my.ticket)


#
# Preferences
#
def get_preference(my, key):
'''Get the user's preference for this project
@params
key - unique key to identify preference
@return
current value of preference
'''
return my.server.get_preference(my.ticket, key)



def set_preference(my, key, value):
'''Set the user's preference for this project
@params
key - unique key to identify preference
value - value to set the preference
'''
return my.server.set_preference(my.ticket, key, value)



#
# Logging facilities
#
Expand Down Expand Up @@ -699,6 +727,21 @@ def log(my, level, message, category="default"):



def get_message(my, key):
'''API Function: gog_message(key)
Get the message with the appropriate key
@params
key - unique key for this message
@return
message
'''
return my.server.get_message(my.ticket, key)



def log_message(my, key, message, status="", category="default"):
'''API Function: log_message(key, message, status=None, category="default")
Expand Down Expand Up @@ -1877,7 +1920,7 @@ def simple_checkin(my, search_key, context, file_path,
checkin_cls='pyasm.checkin.FileCheckin',
context_index_padding=None,
checkin_type="", source_path=None,
version=None
version=None, process=None
):
'''API Function: simple_checkin( search_key, context, file_path, snapshot_type="file", description="No description", use_handoff_dir=False, file_type="main", is_current=True, level_key=None, breadcrumb=False, metadata={}, mode=None, is_revision=False, info={}, keep_file_name=False, create_icon=True, checkin_cls='pyasm.checkin.FileCheckin', context_index_padding=None, checkin_type="strict", source_path=None, version=None )
Expand Down Expand Up @@ -1967,7 +2010,8 @@ def simple_checkin(my, search_key, context, file_path,
metadata, mode, is_revision, info,
keep_file_name, create_icon,
checkin_cls, context_index_padding,
checkin_type, source_path, version)
checkin_type, source_path,
version, process)

if mode == 'local':
# get the naming conventions and move the file to the local repo
Expand Down
2 changes: 1 addition & 1 deletion src/config2/search_type/widget/sthpw/login-conf.xml
Expand Up @@ -379,7 +379,7 @@
<display class="pyasm.widget.ThumbInputWdg"/>
<action class="NullAction"/>
</element>
<element name="picture"/>
<element name="preview"/>

<element name="login">
<action class="LoginAction">
Expand Down
16 changes: 8 additions & 8 deletions src/config2/search_type/widget/sthpw/login_group-conf.xml 100755 → 100644
Expand Up @@ -87,14 +87,14 @@

<!-- a simple less technical interface without using the drop -->
<startup>
<element name="project_code"/>
<element name="login_group"/>
<element name="description"/>
<element name="access_level"/>
<element name="user_assign"/>
<element name="users"/>
<element name="global_rules"/>
<element name="access_rules_hidden"/>
<element name="project_code" width="114"/>
<element name="login_group" width="110"/>
<element name="description" width="280"/>
<element name="access_level" width="100"/>
<element name="user_assign" width="100"/>
<element name="users" width="140"/>
<element name="global_rules" width="80"/>
<element name="access_rules_hidden" width="80"/>
</startup>


Expand Down
14 changes: 13 additions & 1 deletion src/config2/search_type/widget/sthpw/snapshot-conf.xml
Expand Up @@ -118,7 +118,7 @@
</element>


<element edit='false' name='file_size' width="100px">
<element edit='false' name='file_size' width="50px">
<display widget='expression'>
<expression>@GET(sthpw/file.st_size)</expression>
<display_format>KB</display_format>
Expand All @@ -128,6 +128,13 @@



<element edit='false' name='file'>
<display class="tactic.ui.table.SnapshotFileElementWdg">
</display>
</element>



<element edit='false' name='files'>
<display class="tactic.ui.table.HiddenRowElementWdg">
<dynamic_class>tactic.ui.checkin.SnapshotFilesWdg</dynamic_class>
Expand All @@ -142,6 +149,11 @@
</element>


<element edit='false' name='history'>
<display class="tactic.ui.table.SnapshotFileElementWdg">
</display>
</element>




Expand Down
Binary file added src/context/icons/mime-types/adobe-PDF-icon.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/Audition.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/Bridge.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/Encore.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/Fireworks.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/Flash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/InDesign.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/LightRoom.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/Photoshop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/adobe/Prelude.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/css.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/context/icons/mime-types/default_doc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/finaldraft.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/context/icons/mime-types/gnome-textfile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/html.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/icon_qt_big.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/context/icons/mime-types/javascript.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/context/icons/mime-types/quicktime-logo.png
Diff not rendered.
Binary file added src/context/icons/mime-types/txt-notes.png
4 changes: 4 additions & 0 deletions src/context/spt_js/applet.js
Expand Up @@ -986,6 +986,10 @@ spt.Applet.get = function() {

spt.alert('Java applet has not been properly initialized.');
}
else if (e.message.test(/is not a function/)) {
this.applet = null;
log.critical("Java applet is not enabled or updated: " + e.message);
}
else
spt.alert(spt.exception.handler(e));
}
Expand Down
15 changes: 15 additions & 0 deletions src/context/spt_js/client_api.js
Expand Up @@ -226,6 +226,21 @@ TacticServerStub = function() {



/*
* Preferences
*/
this.get_preference = function(key) {
return this._delegate("get_preference", arguments);
}



this.set_preference = function(key, value) {
return this._delegate("set_preference", arguments);
}



/*
* Logging facilities
*/
Expand Down
18 changes: 9 additions & 9 deletions src/context/spt_js/dg_table.js
Expand Up @@ -2969,6 +2969,7 @@ spt.dg_table._search_cbk = function(evt, bvr)
var mode = target.getAttribute("spt_mode");
var no_results_msg = target.getAttribute("spt_no_results_msg");
var show_border = target.getAttribute("spt_show_border");
var show_collection_tool = target.getAttribute("spt_show_collection_tool");

var height = target.getAttribute("spt_height");
var element_names;
Expand Down Expand Up @@ -3047,17 +3048,16 @@ spt.dg_table._search_cbk = function(evt, bvr)
'height': height,
'is_refresh': 'true',
'search_keys': search_keys,
'show_collection_tool': show_collection_tool
}

var pat = /TileLayoutWdg/;
if (pat.test(class_name)) {
var attr_list = ['expand_mode','show_name_hover','scale','sticky_scale','top_view', 'bottom_view','aspect_ratio','show_drop_shadow', 'title_expr', 'overlay_expr', 'overlay_color', 'allow_drag', 'upload_mode','process','gallery_align','detail_element_names'];
for (var k=0; k < attr_list.length; k++) {
var attr_val = target.getAttribute('spt_'+ attr_list[k]);
if (attr_val)
args[attr_list[k]] = attr_val;
}

var pat = /TileLayoutWdg|CollectionLayoutWdg/;
//if (pat.test(class_name)) { }
var attr_list = ['expand_mode','show_name_hover','scale','sticky_scale','top_view', 'bottom_view','aspect_ratio','show_drop_shadow', 'title_expr', 'overlay_expr', 'overlay_color', 'allow_drag', 'upload_mode','process','gallery_align','detail_element_names','hide_checkbox'];
for (var k=0; k < attr_list.length; k++) {
var attr_val = target.getAttribute('spt_'+ attr_list[k]);
if (attr_val)
args[attr_list[k]] = attr_val;
}

if (bvr.extra_args) {
Expand Down
2 changes: 2 additions & 0 deletions src/context/spt_js/mouse.js
Expand Up @@ -1075,6 +1075,8 @@ spt.mouse._create_drag_copy = function( el_to_copy, extra_styling )
}

copy.setStyle( "position", "absolute" );
copy.setStyle( "z-index", "1000" );
copy.setStyle( "background", "#DDD" );
spt.show_block( copy );

var global_container = $("global_container");
Expand Down
2 changes: 1 addition & 1 deletion src/context/spt_js/smart_menu.js
Expand Up @@ -572,7 +572,7 @@ spt.smenu._show_action = function( evt, menu, activation_type, activator_bvr )
spt.smenu._setup_menu_items( menu );

spt.show_block( menu );
menu.setStyle("z-index", "350" );
menu.setStyle("z-index", "1000" );

if( "spt_defer_click_off" in menu ) {
delete menu.spt_defer_click_off;
Expand Down
2 changes: 1 addition & 1 deletion src/install/install.py
Expand Up @@ -409,7 +409,7 @@ def get_version(my):
f = open('%s/VERSION' %current_dir,'r')
version = f.readline()
f.close()
return version
return version.strip()

def in_directory(my, file, directory):
#make both absolute
Expand Down
35 changes: 32 additions & 3 deletions src/pyasm/biz/biz_test.py
Expand Up @@ -64,7 +64,6 @@ def test_all(my):
my.search_code = my.person.get_value("code")
my.context = "test"
my.full_context = "test/subtest"

my._test_instances()

my._test_pipeline()
Expand Down Expand Up @@ -216,6 +215,28 @@ def _test_time(my):
# EST and GMT diff is 5 hours
my.assertEquals(task.get_value('bid_start_date'), '2014-11-11 05:00:00')


# test NOW() auto conversion
sobj = SearchType.create('sthpw/note')
sobj.set_value('process','TEST')
sobj.set_value('note','123')
my.assertEquals(sobj.get_value('timestamp'), "")
sobj.commit()

# this is local commited time converted back to GMT
committed_time = sobj.get_value('timestamp')

from dateutil import parser
committed_time = parser.parse(committed_time)

from pyasm.common import SPTDate
now = SPTDate.now()
diff = now - committed_time
# should be roughly the same minute, not hours apart
my.assertEquals(diff.seconds < 60, True)



#TODO: test with time zone aware columns

def _test_snapshot(my):
Expand Down Expand Up @@ -911,8 +932,9 @@ def _test_instances(my):

test_instances = my.person.get_instances("unittest/car")
my.assertEquals(len(instances), len(test_instances))
my.assertEquals(3, len(instances))


# test search instances
for instance, test_instance in zip(instances, test_instances):
search_key = instance.get_search_key()
Expand All @@ -928,19 +950,26 @@ def _test_instances(my):


# test remove the first instance

my.person.remove_instance(cars[0])

test_instances = my.person.get_instances("unittest/car")


#FIXME: this may fail unless you restart startup_dev.py
my.assertEquals(2, len(test_instances))


# test remove the other way around

cars[1].remove_instance(my.person)

# this doesn't return the expected result even after ExpressionParser.clear_cache()
#test_instances2 = my.person.get_instances("unittest/car")

test_instances2 = Search.eval('@SOBJECT(unittest/person_in_car)', my.person)



my.assertEquals(1, len(test_instances2))
test_instances2 = cars[2].get_instances("unittest/person")
my.assertEquals(1, len(test_instances2))
Expand Down
4 changes: 4 additions & 0 deletions src/pyasm/biz/expression.py
Expand Up @@ -1641,7 +1641,11 @@ def execute_method(my, method, args):
elif method == 'FORMAT':
expression = args[0]
mode = my.get_mode(expression)

result = my.dive(mode, expression=expression)
if not result:
result = expression


args_len = len(args)
if args_len != 0:
Expand Down

0 comments on commit b9047e0

Please sign in to comment.