Use separate root objects to gather the sample visualization and the
[blender-addons-contrib.git] / text_editor_pasteall.py
index 828d6912566e875c9cf7155190497e989b583458..fa5f8effea6d568c179ce11ee41581cf90608e71 100644 (file)
 bl_info = {
     "name": "PasteAll",
     "author": "Dalai Felinto (dfelinto)",
-    "version": (0,7),
-    "blender": (2, 6, 0),
-    "api": 41374,
+    "version": (0, 7),
+    "blender": (2, 60, 0),
     "location": "Text editor > Properties panel",
     "description": "Send your selection or text to www.pasteall.org",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
         "Scripts/Text_Editor/PasteAll",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=23493",
+    "tracker_url": "https://developer.blender.org/T23493",
     "category": "Text Editor"}
 
 # ########################################################
@@ -59,12 +57,12 @@ class TEXT_PT_pasteall(bpy.types.Panel):
     bl_label = "PasteAll.org"
 
     def draw(self, context):
-        layout = self.layout        
+        layout = self.layout
         layout.operator("text.pasteall", icon='URL')
         layout.prop(context.scene, "use_webbrowser")
 
 class TEXT_OT_pasteall(bpy.types.Operator):
-    ''''''
+    """"""
     bl_idname = "text.pasteall"
     bl_label = "PasteAll.org"
     bl_description = "Send the current text or selection to www.pasteall.org"
@@ -97,7 +95,7 @@ class TEXT_OT_pasteall(bpy.types.Operator):
 
         # get the link of the posted page
         page = self.get_page(str(html))
-        
+
         if page is None or page == "":
             self.report({'ERROR'}, "Error in retrieving the page.")
             return {'CANCELLED'}
@@ -111,12 +109,12 @@ class TEXT_OT_pasteall(bpy.types.Operator):
             try:
                 webbrowser.open_new_tab(page)
             except:
-                self.report('WARNING', "Error in opening the page %s." % (page))
+                self.report({'WARNING'}, "Error in opening the page %s." % (page))
 
         return {'FINISHED'}
-            
+
     def send_text(self, text, format):
-        ''''''
+        """"""
         import urllib
         url = "http://www.pasteall.org/index.php"
         values = {  'action' : 'savepaste',
@@ -135,7 +133,7 @@ class TEXT_OT_pasteall(bpy.types.Operator):
             return page_source
 
     def get_page(self, html):
-        ''''''
+        """"""
         id = html.find('directlink')
         id_begin = id + 12 # hardcoded: directlink">
         id_end = html[id_begin:].find("</a>")
@@ -146,13 +144,13 @@ class TEXT_OT_pasteall(bpy.types.Operator):
             return None
 
     def get_selected_text(self, text):
-        ''''''
+        """"""
         current_line = text.current_line
         select_end_line = text.select_end_line
-        
+
         current_character = text.current_character
         select_end_character = text.select_end_character
-        
+
         # if there is no selected text return None
         if current_line == select_end_line:
             if current_character == select_end_character:
@@ -192,9 +190,9 @@ class TEXT_OT_pasteall(bpy.types.Operator):
                         continue
 
         return text_return
-    
+
     def get_file_format(self, text):
-        '''Try to guess what is the format based on the file extension'''
+        """Try to guess what is the format based on the file extension"""
         extensions =   {'diff':'24',
                         'patch':'24',
                         'py':'62',