Esempio n. 1
0
  __apply_cvs_op(filenames, 'update', cb=__message_completion)
   
def _cvs_update_available(filenames=wingapi.kArgFilename):
  if filenames is None or len(filenames) == 0:
    return False
  for filename in filenames:
    if not wingapi.IsUrl(filename):
      dir, version, date, flags = __read_entries_file(filename)
      if version is not None:
        return True
  return False
cvs_update.available = _cvs_update_available
cvs_update.label = _('CVS _Update')

cvs_update.contexts = [wingapi.kContextEditor(), 
                       wingapi.kContextProject(),
                       wingapi.kContextNewMenu(_("_CVS"), 1)]

def cvs_diff(filenames=wingapi.kArgFilename):
  """Perform cvs diff on the given files or directories.  The form of diff
  is controlled from the options dialog."""
  app = wingapi.gApplication
  diff_type = app.fSingletons.fFileAttribMgr[_kDiffTypeAttrib]
  if diff_type == 'default':
    cvs_ndiff(filenames)
  elif diff_type == 'context':
    cvs_cdiff(filenames)
  else:
    cvs_udiff(filenames)
   
cvs_diff.available = _cvs_update_available
Esempio n. 2
0
import subprocess
import tempfile
import wingapi
import thread

_ = gettext.translation('scripts_editor_extensions', fallback=1).ugettext


def gnome_open(filenames=wingapi.kArgFilename):
    """Perform svn diff on the given files or directories."""
    app = wingapi.gApplication
    subprocess.Popen(['gnome-open'] + filenames)


gnome_open.label = _('_Gnome Open')
gnome_open.contexts = [wingapi.kContextEditor(), wingapi.kContextProject()]


def _nautilus_browse_available(filenames=wingapi.kArgFilename):
    for f in filenames:
        if os.path.isdir(f):
            return True


def nautilus_browse(filenames=wingapi.kArgFilename):
    """Perform svn diff on the given files or directories."""
    for f in filenames:
        if os.path.isdir(f):
            subprocess.Popen(['nautilus'] + [f])