Exemplo n.º 1
0
def main():
  
  global logger
  
  logger = log.open_logging()
  
  if len(sys.argv) == 2:  
    if (sys.argv[1].startswith(working_copy.PARAM_IGNORE_WAKEUP)):
      start_gui(False)
    else:
      load_config_file_and_sync(sys.argv[1])
  else:
    start_gui(True)
Exemplo n.º 2
0
def main():
  
  global logger
  
  logger = log.open_logging('gitsynchista', True)
  
  logger.info('Starting gitsynchista')
  if len(sys.argv) == 2:  
    if (sys.argv[1].startswith(working_copy.PARAM_IGNORE_WAKEUP)):
      start_gui(False)
    else:
      load_config_file_and_sync(sys.argv[1])
  else:
    start_gui(True)
  logger.info('Terminating gitsynchista')
Exemplo n.º 3
0
def main():
    global logger
    logger = log.open_logging("gitsynchista", True)
    logger.info("Starting gitsynchista")

    if len(sys.argv) == 2:
        if sys.argv[1].startswith(working_copy.PARAM_IGNORE_WAKEUP):
            start_gui(False)

        else:
            load_config_file_and_sync(sys.argv[1])

    else:
        start_gui(ENABLE_WORKING_COPY_SUPPORT)

    logger.info("Terminating gitsynchista")
Exemplo n.º 4
0
import copy
import string
import ConfigParser

import log

reload(log)

global logger

logger = log.open_logging()

class BaseConfig(object):

    def getIntAttributes(self):
        return list()

    def getBooleanAttributes(self):
        return list()

    def dump(self):
      
      self._dump(self, type(self).__name__ + '.')
      
    def _dump(self, config, parent_prefix):
      
      global logger
            
      for (key, value) in config.__dict__.items():
        
        attr_type = type(getattr(config, key)).__name__
Exemplo n.º 5
0
import urllib
import time
import keychain
import console

import log
import sync_config

reload(log)
reload(sync_config)

PARAM_IGNORE_WAKEUP = 'IGNORE_WAKEUP'

global logger

logger = log.open_logging()


class WorkingCopySupport(object):
    def __init__(self, webdav_config):

        self.webdav_config = webdav_config
        self.key = self._get_key()

    def _get_key(self):
        ''' Retrieve the working copy key or prompt for a new one. See https://github.com/ahenry91/wc_sync
    '''

        key = keychain.get_password('wcSync', 'xcallback')
        if not key:
            key = console.password_alert('Working Copy Key')
Exemplo n.º 6
0
import six

import log

if six.PY2:
    from ConfigParser import ConfigParser

else:
    from configparser import ConfigParser
    from importlib import reload

reload(log)

global logger

logger = log.open_logging(__name__)


class BaseConfig(object):
    def getIntAttributes(self):
        return list()

    def getBooleanAttributes(self):
        return list()

    def dump(self):
        self._dump(conf=self, parent_prefix=type(self).__name__ + '.')

    def _dump(self, conf, parent_prefix):
        global logger
Exemplo n.º 7
0
import working_copy
import pyzipista_support

if six.PY3:
	from importlib import reload
	
reload(log)
reload(ui_util)
reload(popup)
reload(url_scheme_support)
reload(working_copy)
reload(pyzipista_support)

global logger

logger = log.open_logging(__name__)

IMAGE_URL_GITSYNCHISTA_ICON = 'lib/gitsynchista_64.png'
IMAGE_URL_WORKING_COPY_ICON = 'lib/working_copy_64x64.jpg'
IMAGE_URL_PYZIPISTA_ICON = '../pyzipista/lib/pyzipista_64x64.png'
IMAGE_URL_PYZIPISTA_ICON_32 = '../pyzipista/lib/pyzipista_32x32.png'

class SyncSelector(ui_util.ViewController):
  
  def __init__(self, parent_vc=None):
    global logger
    
    super(SyncSelector, self).__init__(parent_vc)
    self.selected_index = None
    self.popup_vc = None
    self.load('sync_selector')
Exemplo n.º 8
0
def main():
  
  global logger
  
  console.clear()
  logger = log.open_logging('rechtschreibung', reload=True)
  logger.info("Start application")
  default_mode = spelling_mode.spelling_mode()
  rulesets.set_default_mode(default_mode.combination)
  
  config_handler = config.ConfigHandler(app_config.AppConfig())
  conf = config_handler.read_config_file(CONFIG_FILE, SAMPLE_CONFIG_FILE)
  
  image_rechtschreibung = ui.Image.named(IMAGE_URL_RECHTSCHREIBUNG).with_rendering_mode(ui.RENDERING_MODE_ORIGINAL)
  my_main_view_controller = MainViewController(conf)
  
  top_navigation_vc = ui_util.ViewController(my_main_view_controller)
  navigation_vc = ui_util.ViewController(top_navigation_vc)
  navigation_vc.load('top_navigation')
  
  top_navigation_view = ui.NavigationView(navigation_vc.view, title_bar_color = defaults.COLOR_GREY)
  top_navigation_view.title_bar_color = defaults.COLOR_LIGHT_GREY
  top_navigation_vc.view = top_navigation_view
  my_main_view_controller.add_child_controller(NAME_NAVIGATION_VIEW, top_navigation_vc)
  top_navigation_view.name = NAME_NAVIGATION_VIEW
  
  if ui_util.is_iphone():
    my_main_view_controller.load('rechtschreibung_iphone')
    app_control_vc = ui_util.ViewController(my_main_view_controller)
    app_control_vc.load('rechtschreibung_app_control_iphone')
    my_main_view_controller.add_left_button_item(NAME_NAVIGATION_VIEW_TOP_LEVEL, 'button_close_top_navigation_view', ui.ButtonItem(image=ui.Image.named('iob:close_round_32')))
    
    button_item_list = [
      ui.ButtonItem(image=ui.Image.named('lib/ios7_toggle_32.png'), action=my_main_view_controller.handle_action, title='button_open_top_navigation_view'),  
      ui.ButtonItem(image=ui.Image.named('ionicons-gear-a-32'), action=my_main_view_controller.handle_action, title='button_open_app_control_view'),
      ui.ButtonItem(image=image_rechtschreibung, action=my_main_view_controller.handle_action, title='button_icon_rechtschreibung'),
    ]
    my_main_view_controller.set_right_button_item_list('Rechtschreibung', button_item_list)
        
  else:
    my_main_view_controller.load('rechtschreibung')
    my_main_view_controller.add_right_button_item('Rechtschreibung', 'button_icon_rechtschreibung', ui.ButtonItem(image=image_rechtschreibung))
    my_main_view_controller.add_subview('view_container_navigation', top_navigation_vc.view)
    
  view = my_main_view_controller.find_subview_by_name('segmented_control_highlighting_mode')
  view.action = my_main_view_controller.handle_action

  view_controller_capitalization = ui_util.ViewController(my_main_view_controller)
  view_controller_capitalization.load('view_capitalization')
  
  view_controller_harmonization = ui_util.ViewController(my_main_view_controller)
  view_controller_harmonization.load('view_harmonization')
  view = my_main_view_controller.find_subview_by_name('segmented_control_harmonization_elongation')
  view.action = my_main_view_controller.handle_action
  
  view_controller_combinations_simplification = ui_util.ViewController(my_main_view_controller)
  view_controller_combinations_simplification.load('view_combinations_simplification')
  
  view_controller_combinations_simplification_vowels = ui_util.ViewController(my_main_view_controller)
  view_controller_combinations_simplification_vowels.load('view_combinations_simplification_vowels')
  
  view_controller_punctuation = ui_util.ViewController(my_main_view_controller) 
  view_controller_punctuation.load('view_punctuation')
  
  view_controller_legacy = ui_util.ViewController(my_main_view_controller) 
  view_controller_legacy.load('view_legacy')
  
  view_controller_layout = ui_util.ViewController(my_main_view_controller) 
  view_controller_layout.load('view_layout')

  view_controller_misc_rules = ui_util.ViewController(my_main_view_controller) 
  view_controller_misc_rules.load('view_misc_rules')

  my_main_view_controller.set_model(default_mode.combination)
  
  # Set the empty html page for displaying the sample text. The actual content will be set in
  # method "update_sample_text". We use an absolute path to load the page so that the relative
  # path reference to the style sheet can be derrived by the browser.
  text_view = my_main_view_controller.find_subview_by_name('webview_text_view')
  absolute_page_path = 'file:' + os.path.abspath('etc/text_page.html')
  logger.info('Loading HTML page at %s' % absolute_page_path)
  text_view.load_url(absolute_page_path)
  
  # Wait for a fraction of a second so that load_url() above (which seems to be aynchronous)
  # has a chance to load the page before update_sample_text() below sets the initial content.
  time.sleep(1.0 * conf.rechtschreibung.initial_update_sample_text_delay / 1000.0)
  
  my_main_view_controller.update_sample_text()
  my_main_view_controller.present('fullscreen', title_bar_color=defaults.COLOR_GREY)
  speech.stop()
  logger.info("Terminate application")
Exemplo n.º 9
0
import six

if six.PY3:
    from importlib import reload

import log
import config
import zip_handler_config

reload(log)
reload(config)
reload(zip_handler_config)

global logger

logger = log.open_logging('pyzipista', reload=True)

UNZIP_TEMPLATE_FILE = '../pyzipista/etc/zip_template.py'
BASE64_PLACEHOLDER = b'[BASE64]'
MOD_TIMES_PLACEHOLDER = b'[MOD_TIMES]'
APP_NAME_PLACEHOLDER = b'[APPNAME]'
APP_URL_PLACEHOLDER = b'[APPURL]'
GIT_IGNORE_FILE = '.gitignore'
PYZIPISTA_CONFIG_FILE = 'pyzipista_config'
CONFIG_FILE_SEARCH_PATH = ['.', 'etc']
GITSYNCHISTA_IGNORE_FILE = 'gitsynchista_ignore'
GITSYNCHISTA_IGNORE_FILE_2 = 'gitsynchista_ignore.txt'
PYZIPISTA_IGNORE_FILE = 'pyzipista_ignore'
PYZIPISTA_IGNORE_FILE_2 = 'pyzipista_ignore.txt'
ADDITIONAL_IGNORE_PATTERNS = '|\..*'
Exemplo n.º 10
0
# coding: utf-8
# This file is part of https://github.com/marcus67/pyzipista

import six

import log
import pyzipista

if six.PY3:
    from importlib import reload

reload(log)
reload(pyzipista)

global logger

logger = log.open_logging('test', reload=True)


def test():

    global logger

    pyzipista.load_config_file_and_check_zip_required('etc/pyzipista_config')


if __name__ == '__main__':
    test()