Branch: refs/heads/master Author: Enrico enrico.trt@gmail.com Committer: Enrico enrico.trt@gmail.com Date: Wed, 02 May 2012 20:19:29 Commit: 6acdb3aebb85d978b7b7953ca46a6b884e3da44a https://github.com/geany/geany-plugins/commit/6acdb3aebb85d978b7b7953ca46a6b...
Log Message: ----------- added handling of errors, overall clean of the code, removed uneeded code
Modified Paths: -------------- geniuspaste/src/geniuspaste.c geniuspaste/wscript_build geniuspaste/wscript_configure po/POTFILES.in
Modified: geniuspaste/src/geniuspaste.c 47 files changed, 24 insertions(+), 23 deletions(-) =================================================================== @@ -1,3 +1,4 @@ + /* * geniuspaste - paste your code on your favorite pastebin. * @@ -30,9 +31,9 @@ #include <geanyplugin.h>
#ifdef G_OS_WIN32 - #define USERNAME getenv("USERNAME") + #define USERNAME getenv("USERNAME") #else - #define USERNAME getenv("USER") + #define USERNAME getenv("USER") #endif
#define CODEPAD_ORG 0 @@ -48,16 +49,16 @@ static GtkWidget *main_menu_item = NULL;
static const gchar *websites[] = { - "http://codepad.org", - "http://pastebin.com/api_public.php", - "http://pastebin.geany.org/api/", - "http://dpaste.de/api/", - "http://sprunge.us/", +"http://codepad.org", +"http://pastebin.com/api_public.php", +"http://pastebin.geany.org/api/", +"http://dpaste.de/api/", +"http://sprunge.us/", };
static struct { - GtkWidget *combo; - GtkWidget *check_button; + GtkWidget *combo; + GtkWidget *check_button; } widgets;
static gint website_selected; @@ -65,9 +66,9 @@
PLUGIN_VERSION_CHECK(147) PLUGIN_SET_INFO("GeniusPaste", - "Paste your code on your favorite pastebin", - "0.1", - "Enrico Trotta"); + "Paste your code on your favorite pastebin", + "0.1", + "Enrico Trotta");
static gint indexof(const gchar * string, gchar c) { @@ -131,7 +132,7 @@ static void paste(const gchar * website) "submit", "Submit", NULL); break; - + case PASTEBIN_COM: result = g_file_get_contents(f_path, &f_content, &f_lenght, &error); @@ -145,8 +146,8 @@ static void paste(const gchar * website) formdata = soup_form_encode("paste_code", f_content, "paste_format", f_type, "paste_name", f_title, NULL); break; - - + + case DPASTE_DE: printf("%s\n", f_type); @@ -165,34 +166,34 @@ static void paste(const gchar * website) "lexer", f_type, NULL); break; - + case SPRUNGE_US: - + result = g_file_get_contents(f_path, &f_content, &f_lenght, &error); if(result == FALSE) { dialogs_show_msgbox(GTK_MESSAGE_ERROR, "Unable to the the content of the file"); g_error_free(error); return; } - + msg = soup_message_new("POST", website); formdata = soup_form_encode("sprunge", f_content, NULL); - + break; - + case PASTEBIN_GEANY_ORG: - + result = g_file_get_contents(f_path, &f_content, &f_lenght, &error); if(result == FALSE) { dialogs_show_msgbox(GTK_MESSAGE_ERROR, "Unable to the the content of the file"); g_error_free(error); return; } - + msg = soup_message_new("POST", website); formdata = soup_form_encode("content", f_content, "author", USERNAME, "title", f_title, "lexer", f_type, NULL); - + break;
}
Modified: geniuspaste/wscript_build 31 files changed, 31 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# +# WAF build script for geany-plugins - Update Checker +# +# Copyright 2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> +# Copyright 2011-2012 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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. +# +# $Id$ + +from build.wafutils import build_plugin + + +name = 'geniuspaste' +includes = ['geniuspaste/src'] +libraries = ['LIBSOUP'] + +build_plugin(bld, name, includes=includes, libraries=libraries)
Modified: geniuspaste/wscript_configure 36 files changed, 36 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# +# WAF build script for geany-plugins - GeniusPaste +# +# Copyright 2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> +# Copyright 2011-2012 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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. +# +# $Id$ + +from build.wafutils import check_cfg_cached + +packages = [ + ('libsoup-2.4', '2.4.0', 'LIBSOUP') + ] + +for package_name, package_version, uselib_store in packages: + check_cfg_cached(conf, + package=package_name, + atleast_version=package_version, + uselib_store=uselib_store, + mandatory=True, + args='--cflags --libs')
Modified: po/POTFILES.in 3 files changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -208,6 +208,9 @@ geanyvc/src/vc_svk.c geanyvc/src/vc_svn.c geanyvc/src/utils.c
+# GeniusPaste +geniuspaste/src/geniuspaste.c + # GProject gproject/src/gproject-main.c gproject/src/gproject-menu.c
@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
plugins-commits@lists.geany.org