Пример #1
0
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

import wx
from wx.lib import dialogs
from os import path
from types import *
from gamera import util
from gamera.gui import compat_wx
from gamera.config import config
import sys
import datetime

config.add_option("",
                  "--default-dir",
                  default=".",
                  help="[gui] The default directory when opening files")

colors = (wx.Colour(0xbc, 0x2d, 0x2d), wx.Colour(0xb4, 0x2d, 0xbc),
          wx.Colour(0x2d, 0x34, 0xbc), wx.Colour(0x2d, 0xbc, 0x2d),
          wx.Colour(0x2d, 0xbc, 0xbc), wx.Colour(0xbc, 0xb7, 0x2d),
          wx.Colour(0xbc, 0x88, 0x2d), wx.Colour(0x6e, 0x00, 0xc7))

color_number = 0


def get_color(number):
    global color_number
    if isinstance(number, wx.Colour):
        return number
    if util.is_sequence(number):
Пример #2
0
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

import wx
from wx.lib import dialogs
from os import path
from types import *
from gamera import util
from gamera.config import config
import sys

config.add_option(
   "", "--default-dir", default=".",
   help="[gui] The default directory when opening files")

colors = (wx.Colour(0xbc, 0x2d, 0x2d), wx.Colour(0xb4, 0x2d, 0xbc),
          wx.Colour(0x2d, 0x34, 0xbc), wx.Colour(0x2d, 0xbc, 0x2d),
          wx.Colour(0x2d, 0xbc, 0xbc), wx.Colour(0xbc, 0xb7, 0x2d),
          wx.Colour(0xbc, 0x88, 0x2d), wx.Colour(0x6e, 0x00, 0xc7))

color_number = 0
def get_color(number):
   global color_number
   if isinstance(number, wx.Colour):
      return number
   if util.is_sequence(number):
      if len(number) == 3:
         return wx.Colour(*tuple(number))
Пример #3
0
from gamera import paths, util
from gamera.gui import gamera_display, image_menu, \
   icon_display, classifier_display, var_name, gui_util, \
   image_browser, has_gui, compat_wx

# wxPython
import wx
import wx.py

# Python standard library
# import interactive
import sys, traceback, os, string, os.path, imp

# Set default options
config.add_option(
   "", "--shell-font-face", default=wx.py.editwindow.FACES['mono'],
   help="[shell] Font face used in the shell")
config.add_option(
   "", "--shell-font-size", default=wx.py.editwindow.FACES['size'],
   type="int",
   help="[shell] Font size used in the shell")
config.add_option(
   "-e", "--execfile", type="string", action="append",
   help="[shell] Run execfile(...) on the given file.  This argument may be given multiple times")
config.add_option(
   "-v", "--verbosity-level", type="int", default=1,
   help="[shell] when non zero, debug messages on loaded plugins etc. are written to stdout.")


main_win = None
app = None
Пример #4
0
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

from __future__ import generators

import string, sys, traceback, re, warnings  ## Python standard
from types import *
from math import pow
from gamera.enums import *
from gamera.gui import has_gui
from gamera.config import config
from gamera.backport import sets, textwrap

config.add_option("-p",
                  "--progress-bar",
                  action="store_true",
                  help="[console] Display textual progress bars on stdout")


def is_sequence(obj):
    "Check if an object is a sequence."
    return type(obj) in (list, tuple)


def make_sequence(obj):
    "Make an object into a sequence if it isn't one."
    if not is_sequence(obj):
        return [obj]
    return obj

Пример #5
0
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

from __future__ import generators

import string, sys, traceback, re, warnings   ## Python standard
from types import *
from math import pow
from gamera.enums import *
from gamera.gui import has_gui
from gamera.config import config
from gamera.backport import sets, textwrap

config.add_option(
   "-p", "--progress-bar", action="store_true",
   help="[console] Display textual progress bars on stdout")

def is_sequence(obj):
   "Check if an object is a sequence."
   return type(obj) in (list, tuple)

def make_sequence(obj):
   "Make an object into a sequence if it isn't one."
   if not is_sequence(obj):
      return [obj]
   return obj

def is_image_list(l):
   from gamera.core import ImageBase
   if not is_sequence(l):
Пример #6
0
from gamera import paths, util
from gamera.gui import gamera_display, image_menu, \
     icon_display, classifier_display, var_name, gui_util, \
     image_browser, has_gui

# wxPython
import wx
import wx.py

# Python standard library
# import interactive
import sys, traceback, os, string, os.path, imp

# Set default options
config.add_option(
   "", "--shell-font-face", default=wx.py.editwindow.FACES['mono'],
   help="[shell] Font face used in the shell")
config.add_option(
   "", "--shell-font-size", default=wx.py.editwindow.FACES['size'],
   type="int",
   help="[shell] Font size used in the shell")
config.add_option(
   "-e", "--execfile", type="string", action="append",
   help="[shell] Run execfile(...) on the given file.  This argument may be given multiple times")
config.add_option(
   "-v", "--verbosity-level", type="int", default=1,
   help="[shell] when non zero, debug messages on loaded plugins etc. are written to stdout.")


main_win = None
app = None