diff options
author | root <root@rshg054.dnsready.net> | 2013-07-19 01:10:32 -0700 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2013-07-19 01:10:32 -0700 |
commit | 8fbc0076a4827ddc6af92e0b9daa4c4c31450808 (patch) | |
tree | 03fd0e2921ebd53228d9a93e32ed3976b636cbea /community/avant-window-navigator/821_820.diff | |
parent | e445a313723389ba9ee1fded025c567dae5b21ea (diff) |
Fri Jul 19 01:09:18 PDT 2013
Diffstat (limited to 'community/avant-window-navigator/821_820.diff')
-rw-r--r-- | community/avant-window-navigator/821_820.diff | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/community/avant-window-navigator/821_820.diff b/community/avant-window-navigator/821_820.diff new file mode 100644 index 000000000..bd8c5b279 --- /dev/null +++ b/community/avant-window-navigator/821_820.diff @@ -0,0 +1,96 @@ +=== modified file 'awn-settings/awnClass.py' +--- awn-settings/awnClass.py 2010-08-24 00:21:51 +0000 ++++ awn-settings/awnClass.py 2011-02-13 23:43:42 +0000 +@@ -53,9 +53,13 @@ + import tempfile + import dbus + +-from bzrlib import branch +-from bzrlib.builtins import cmd_branch, cmd_pull +-from bzrlib.plugins.launchpad.lp_directory import LaunchpadDirectory ++try: ++ from bzrlib import branch ++ from bzrlib.builtins import cmd_branch, cmd_pull ++ from bzrlib.plugins.launchpad.lp_directory import LaunchpadDirectory ++ support_bzr = True ++except: ++ support_bzr = False + + defs.i18nize(globals()) + +@@ -127,8 +131,11 @@ + path: a url from a branch + return: the http format of a lp: format, or the same url + ''' +- directory = LaunchpadDirectory() +- return directory._resolve(path).replace("bzr+ssh","http") ++ if support_bzr == True: ++ directory = LaunchpadDirectory() ++ return directory._resolve(path).replace("bzr+ssh","http") ++ else: ++ return path + + def read_list(self, file_path): + ''' Read a flat file and return the content in a list +@@ -148,34 +155,44 @@ + path: the path of the branch + bzr_dir: the location of the futur tree. + ''' +- if os.path.exists(path): +- print ("Error, the path already exist") ++ if support_bzr == False: ++ print (_("Bzr support is not enable, try to install bzr")) + else: +- try: +- bzr_branch = cmd_branch() +- status = StringIO() +- status = bzr_branch._setup_outf() +- bzr_branch.run(from_location=self.lp_path_normalize(bzr_dir), to_location=path) +- except socket.gaierror: +- print 'Socket error, could not create branch.' ++ if os.path.exists(path): ++ print (_("Error, the path already exist")) ++ else: ++ try: ++ bzr_branch = cmd_branch() ++ status = StringIO() ++ status = bzr_branch._setup_outf() ++ bzr_branch.run(from_location=self.lp_path_normalize(bzr_dir), to_location=path) ++ except socket.gaierror: ++ print (_('Socket error, could not create branch.')) + + def update_branch(self, path): + ''' Update a local branch + path: Location of the branch + Return the output of the command + ''' +- bzr_pull = cmd_pull() +- status = StringIO() +- status = bzr_pull._setup_outf() +- bzr_pull.run(directory=path) ++ if support_bzr == False: ++ print (_("Bzr support is not enable, try to install bzr")) ++ else: ++ bzr_pull = cmd_pull() ++ status = StringIO() ++ status = bzr_pull._setup_outf() ++ bzr_pull.run(directory=path) + + def get_revision_from_path(self, path): + ''' Return the last revision number of the branch + specify with path parameter + ''' +- tree = branch.Branch.open(path) +- revision_number, revision_id = tree.last_revision_info() +- return revision_number ++ if support_bzr == False: ++ print (_("Bzr support is not enable, try to install bzr")) ++ return 0 ++ else: ++ tree = branch.Branch.open(path) ++ revision_number, revision_id = tree.last_revision_info() ++ return revision_number + + #Sources.list + def dict_from_sources_list(self, config=defs.HOME_CONFIG_DIR): + |