def Share(sender):
    # if copy is True, share results
    global copy

    if copy:
        ml = sender.superview['main-label']
        dialogs.share_text(ml.text)
    else:
        hud_alert('Nothing to Share', 'error')
Beispiel #2
0
def action_share_multiple(sender):
    """Open the iOS share dialog to export selected words and notes."""
    table = sender.superview.superview['table']
    words = []
    for row in table.selected_rows:
        cell = vocab.tableview_cell_for_row(table, row[0], row[1])
        word = cell.text_label.text
        definition = vocab.get_notes(word)
        words.append(export_notes_format(word, definition))
    dialogs.share_text('\n\n----\n\n'.join(words))
Beispiel #3
0
 def action_share(self, sender):
     """Open the iOS share dialog to export a word or its notes."""
     options = ['Share Word', 'Share Word & Notes']
     d = dialogs.list_dialog(items=options, title='Share Word')
     word = self['word'].text
     if d == options[0]:
         text = word
     elif d == options[1]:
         text = export_notes_format(word, self['textview'].text)
     else:  # no option was selected
         return
     dialogs.share_text(text)
Beispiel #4
0
def main():
    if appex.is_running_extension():
        shared = appex.get_input()
        if shared: tasks = get_tasks(shared)
        for task in tasks:
            dialogs.share_text(task)
	def share(sender):
		dialogs.share_text(log_text)
# https://forum.omz-software.com/topic/3605/how-do-i-transfer-code-such-as-pc-to-ipad/7

import dialogs, clipboard

dialogs.share_text(clipboard.get())
def share(sender):
    dialogs.share_text(thoughts.text)
 def share_action(self, sender):
     text = self.get_text()
     if text is None:
         return
     dialogs.share_text(text)
Beispiel #9
0
    'language': 'en',
    'detectOrientation': 'true',
})

body = {
    "Url": final,
}

print 'Performing OCR...'

body = json.dumps(body)

conn = httplib.HTTPSConnection('api.projectoxford.ai')
conn.request("POST", urlOcr, body, headers)
response = conn.getresponse()
back = response.read()
conn.close()

print 'OCR successfully performed.'
data = json.loads(back)

s = ''

for item in data["regions"]:
    for line in item["lines"]:
        for word in line["words"]:
            s += ' ' + word["text"]

print s
dialogs.share_text(s)
Beispiel #10
0
def share(sender):
    dialogs.share_text(thoughts.text)
Beispiel #11
0
 def share_button(self, sender):
     if self.info['japanese_title']:
        title = self.info['japanese_title']
     else:
        title = self.info['english_title']
     dialogs.share_text(title + '\n' + self.info['url'])
Beispiel #12
0
def exportt(sender):
    dialogs.share_text(out)
Beispiel #13
0
def share(sender):
    dialogs.share_text(thought_bubble.text)
Beispiel #14
0
 def share(sender):
     dialogs.share_text(log_text)
def button_action(sender):
    dialogs.share_text('test')
Beispiel #16
0
        def bot_btn_action(self, sender):
            # Refresh
            if sender.name == self.btn_4.name:
                self.refresh_last_voucher()
                self.refresh_table()

            # Generate
            elif sender.name == self.btn_5.name:
                self.c.generate_voucher()
                if self.check_api_call():
                    self.refresh_last_voucher()
                    self.refresh_table()

            # Settings
            elif sender.name == self.btn_6.name:
                alert_result = console.alert('Settings',
                                             "change:",
                                             button1='Configuration',
                                             button2='Reset app!')
                #selected button is returned as an integer

                # Change limit and offset
                if alert_result == 1:
                    return_dict = dialogs.form_dialog(
                        title='Configuration',
                        fields=[
                            {
                                'key': 'limit',
                                'type': 'number',
                                'title': 'Limit voucher list',
                                'value': self.c.get_config('limit')
                            },
                            {
                                'key': 'offset',
                                'type': 'number',
                                'title': 'Offset in voucher list',
                                'value': self.c.get_config('offset')
                            },
                            {
                                'key': 'package',
                                'type': 'number',
                                'title': 'Voucher package id nr',
                                'value': self.c.get_config('package')
                            },
                            {
                                'key': 'package_filter',
                                'type': 'text',
                                'title': 'Filter vouchers by string',
                                'value': self.c.get_config('package_filter')
                            },
                        ],
                        sections=None)

                    limit = return_dict['limit']
                    if not limit.isdigit():
                        limit = "100"
                    self.c.write_config('limit', limit)

                    offset = return_dict['offset']
                    if not offset.isdigit():
                        offset = "0"
                    self.c.write_config('offset', offset)

                    package = return_dict['package']
                    if not package.isdigit():
                        package = "1"
                    self.c.write_config('package', package)

                    package_filter = return_dict['package_filter']
                    self.c.write_config('package_filter', package_filter)

                # Reset app
                elif alert_result == 2:
                    # Get safety code
                    reset_code = console.input_alert(
                        "Safety code", "Please input safety code to reset app",
                        "", "OK - Reset app!")

                    # If correct reset code
                    if reset_code == self.c.get_config('reset_code'):
                        if os.path.exists(CONFIG_FILEPATH):
                            os.remove(CONFIG_FILEPATH)
                        self.c.write_config('reset', True)
                        self.setup_configuration()

                    # If not correct safety code
                    else:
                        console.hud_alert(
                            self.c.get_config(key='Wrong safety code.'),
                            'error')

                # Printe to screen
                self.txtv_1.text = "Settings:\nlimit=%s\noffset=%s" % (
                    self.c.get_config('limit'), self.c.get_config('offset'))
                self.txtv_2.text = "package=%s" % (
                    self.c.get_config('package'))

            # Print
            elif sender.name == self.btn_7.name:
                #console.hud_alert("Print", 'success')
                print_result = console.alert('Print vouchers',
                                             "Print or share to system?",
                                             button1='Print current voucher',
                                             button2='Print all vouchers',
                                             button3='Share to system')

                # Send current voucher to "real" printer
                if print_result == 1:
                    string = self.c.get_generated_voucher_string()
                    self.print_text(text=string)

                # Send all vouchers to "real" printer
                elif print_result == 2:
                    string = self.c.get_all_vouchers_string()
                    self.print_text(text=string,
                                    font_name='Courier',
                                    font_size=7)

                # Share to system
                elif print_result == 3:
                    share_result = console.alert('Share vouchers',
                                                 "to system",
                                                 button1='Current voucher',
                                                 button2='All vouchers')

                    # Send current voucher to system
                    if share_result == 1:
                        string = self.c.get_generated_voucher_string()
                        dialogs.share_text(string)

                    # Send all vouchers to system
                    elif share_result == 2:
                        string = self.c.get_all_vouchers_string()
                        dialogs.share_text(string)