コード例 #1
0
def run(args):
    try:
        share_id = args[0]
    except Exception:
        return

    # Start an hourglass with an unspecified app,
    # remove it as soon as we have a download resolution
    hourglass_start("")

    success, text, share = get_share_by_id(share_id)
    if not success:
        msg = "Error downloading share: {}".format(text)
        logger.error(msg)
        hourglass_end()
        return

    success, data = download_share(share)
    if not success:
        msg = "Could not download share, error: {}".format(data)
        logger.error(msg)
        hourglass_end()
        return

    data.append(share_id)
    hourglass_end()
    return data
コード例 #2
0
def run(args):
    try:
        share_id = args[0]
    except Exception:
        return

    # Start an hourglass with an unspecified app,
    # remove it as soon as we have a download resolution
    hourglass_start("")

    success, text, share = get_share_by_id(share_id)
    if not success:
        msg = "Error downloading share: {}".format(text)
        logger.error(msg)
        hourglass_end()
        return

    success, data = download_share(share)
    if not success:
        msg = "Could not download share, error: {}".format(data)
        logger.error(msg)
        hourglass_end()
        return

    data.append(share_id)
    hourglass_end()
    return data
コード例 #3
0
ファイル: testmodule.py プロジェクト: KanoComputing/kdesk
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
# A python test app to load and call the kdesk-hourglass dynamic library
#

from kdesk.hourglass import hourglass_start, hourglass_start_appcmd, hourglass_end
import os
import sys
import time

# Application to test for startup hourglass
app='/usr/bin/xcalc'
appname='xcalc'

# testing the appname API
hourglass_start(appname)
rc = os.system(app)
if (rc!=0):
    hourglass_end()
    sys.exit(1)

time.sleep(1)

# testing the cmdline API
hourglass_start_appcmd(app)
rc = os.system(app)
if (rc!=0):
    hourglass_end()
    sys.exit(1)
    
print 'byebye!'
コード例 #4
0
ファイル: projects.py プロジェクト: japonophile/kano-profile
 def load(self, _button, app, filename, data_dir):
     hourglass_start(app)
     rc = launch_project(app, filename, data_dir)
     if not rc == 0:
         hourglass_end()
コード例 #5
0
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
# A python test app to load and call the kdesk-hourglass dynamic library
#

from kdesk.hourglass import hourglass_start, hourglass_start_appcmd, hourglass_end
import os
import sys
import time

# Application to test for startup hourglass
app = '/usr/bin/xcalc'
appname = 'xcalc'

# testing the appname API
hourglass_start(appname)
rc = os.system(app)
if (rc != 0):
    hourglass_end()
    sys.exit(1)

time.sleep(1)

# testing the cmdline API
hourglass_start_appcmd(app)
rc = os.system(app)
if (rc != 0):
    hourglass_end()
    sys.exit(1)

print 'byebye!'