nemo-python-3.6.0+sylvia/0000755000175000017500000000000013173636707014237 5ustar fabiofabionemo-python-3.6.0+sylvia/COPYING0000644000175000017500000004325413173636707015302 0ustar fabiofabio GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. nemo-python-3.6.0+sylvia/config.h.in0000644000175000017500000000356013173636707016266 0ustar fabiofabio/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Nemo' extensions directory */ #undef NEMO_EXTENSION_DIR /* Nemo libdir */ #undef NEMO_LIBDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* PyGObject major version. */ #undef PYGOBJECT_MAJOR_VERSION /* PyGObject micro version. */ #undef PYGOBJECT_MICRO_VERSION /* PyGObject minor version. */ #undef PYGOBJECT_MINOR_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION nemo-python-3.6.0+sylvia/debian/0000755000175000017500000000000013173645641015456 5ustar fabiofabionemo-python-3.6.0+sylvia/docs/0000755000175000017500000000000013173636707015167 5ustar fabiofabionemo-python-3.6.0+sylvia/docs/xsl/0000755000175000017500000000000013173636707015775 5ustar fabiofabionemo-python-3.6.0+sylvia/docs/xsl/pdf.xsl0000644000175000017500000001710513173636707017302 0ustar fabiofabio ]> 0.5in 1 class ( )  : &RE; ,   , , ,          = void  , def ( ) ( ) nemo-python-3.6.0+sylvia/docs/xsl/common.xsl0000644000175000017500000000066613173636707020025 0ustar fabiofabio nemo-python-3.6.0+sylvia/docs/xsl/pdf-style.xsl0000644000175000017500000000064013173636707020434 0ustar fabiofabio nemo-python-3.6.0+sylvia/docs/xsl/devhelp.xsl0000644000175000017500000001303313173636707020154 0ustar fabiofabio book .devhelp , nemo-python-3.6.0+sylvia/docs/xsl/fixxref.py0000755000175000017500000000342713173636707020033 0ustar fabiofabio#!/usr/bin/env python # -*- Mode: Python; py-indent-offset: 4 -*- import getopt import os import re import sys anchors = {} anchor_pat = re.compile(r'''^\s*''', re.MULTILINE | re.VERBOSE) link_pat = re.compile(r'''(.*?) ''', re.DOTALL | re.VERBOSE) def scan_index_dir(idir): for root, dirs, files in os.walk(idir): if 'index.sgml' in files: scan_index_file(os.path.join(root, 'index.sgml')) return def scan_index_file(ifile): buf = open(ifile).read() for id, href in anchor_pat.findall(buf): anchors[id] = href def fix_xrefs(hdir): for f in os.listdir(hdir): if os.path.splitext(f)[1] == '.html': fix_html_file(os.path.join(hdir, f)) def link_subst(m): id, text = m.groups() if anchors.has_key(id): return '' + text + '' return text def fix_html_file(hfile): buf = open(hfile).read() buf = link_pat.sub(link_subst, buf) open(hfile, 'w').write(buf) def usage(e=None): if e: sys.stderr.write('fixxref.py: %s\n' % e) sys.stderr.write('usage: fixxref.py [-i index-dir] html-dir\n') sys.exit(1) if __name__ == '__main__': try: opts, args = getopt.getopt(sys.argv[1:], "i:h:", ["index-dir=", "html-dir="]) except getopt.error, e: usage(e) index_dirs = [] for opt, arg in opts: if opt in ('-i', '--index-dir'): index_dirs.append(arg) if len(args) != 1: usage() for idir in index_dirs: scan_index_dir(idir) html_dir = args[0] fix_xrefs(html_dir) nemo-python-3.6.0+sylvia/docs/xsl/style.css0000644000175000017500000000020513173636707017644 0ustar fabiofabio.programlisting { font: monospace; background-color: #E0E0E0; padding: 5; } pre.synopsis { background-color: #E0E0E0; padding: 5; } nemo-python-3.6.0+sylvia/docs/xsl/html.xsl0000644000175000017500000002044613173636707017477 0ustar fabiofabio ]> style.css
   
--  
      class 
      
      
        (
                )
      
      :&RE;

      
    
,   , , ,          = void  , def ( ) ( )
nemo-python-3.6.0+sylvia/docs/xsl/ref-html-style.xsl0000644000175000017500000000361213173636707021403 0ustar fabiofabio <ANCHOR id=" " href=" / "> nemo-python-3.6.0+sylvia/docs/reference/0000755000175000017500000000000013173636707017125 5ustar fabiofabionemo-python-3.6.0+sylvia/docs/reference/nemo-python-enum-reference.xml0000644000175000017500000000054713173636707025030 0ustar fabiofabio Available Enums nemo-python-3.6.0+sylvia/docs/reference/nemo-python-menu-item.xml0000644000175000017500000002377613173636707024041 0ustar fabiofabio Nemo.MenuItem Nemo.MenuItem Reference Synopsis Nemo.MenuItem gobject.GObject Nemo.MenuItem name label tooltip icon activate set_submenu menu Ancestry +-- gobject.GObject +-- Nemo.MenuItem Description Nemo.MenuItem objects are appended to lists to create menus and submenus. Properties
"icon" Name of the icon to display in the menu item. Default value: None Read-Write "label" The label to display to the user. Default value: None Read-Write "menu" The Nemo.Menu menu object belonging to this item. May be None. Read-Write "name" The name of the item. Default value: None Read-Write-ConstructOnly "priority" Whether or not to show priority text in toolbars. Default value: True Read-Write "sensitive" Whether or not the menu item is sensitive. Default value: True Read-Write "tip" The tooltip for the menu item. Default value: None Read-Write
Signals "activate" callback item user_param1 ... Constructor Nemo.MenuItem name label tooltip icon name : identifier of the item label : the user-visible label for the item tooltip : the user-visible tooltip for the item icon : Name of the icon to display in the item Creates a new Nemo.MenuItem object. Public Methods Nemo.MenuItem.activate activate Generates the "activate" signal for this Nemo.MenuItem. Nemo.MenuItem.set_submenu set_submenu menu menu : a Nemo.Menu Attaches a Nemo.Menu as the submenu for this Nemo.MenuItem. Signal Details The "activate" Nemo.MenuItem Signal callback item user_param1 ... item : the Nemo.MenuItem being activated user_param1 : User-defined parameter the user attaches to the signal connector ... : Additional parameter(s) the user attaches to the signal connector Emits the "activate" signal.
nemo-python-3.6.0+sylvia/docs/reference/entities.docbook.in0000644000175000017500000000003613173636707022717 0ustar fabiofabio nemo-python-3.6.0+sylvia/docs/reference/nemo-python-ref.xml0000644000175000017500000000222513173636707022677 0ustar fabiofabio %entities; ]> &builddate; nemo-python Reference Manual Reference Manual for nemo-python &version; For nemo-python version &version; Adam Plumb This reference describes the classes of the nemo-python module. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-class-reference.xml0000644000175000017500000000105313173636707025162 0ustar fabiofabio Available Classes nemo-python-3.6.0+sylvia/docs/reference/nemo-python-column.xml0000644000175000017500000001263113173636707023422 0ustar fabiofabio Nemo.Column Nemo.Column Reference Synopsis Nemo.Column gobject.GObject Nemo.Column name attribute label description Ancestry +-- gobject.GObject +-- Nemo.Column Description A list of Nemo.Column objects is returned by Nemo.ColumnProvider extensions. Properties
"attribute" The attribute name to display. Default value: None Read-Write "attribute-q" The attribute name to display, in quark form. Default value: 0 Read "description" The user-visible description of the column. Default value: None Read-Write "label" The label to display in the column. Default value: None Read-Write "name" The name of the column. Default value: None Read-Write-ConstructOnly "xalign" The x-alignment of the column. Allowed values: [0,1]. Default value: 0 Read-Write
Constructor Nemo.Column name attribute label description name : identifier of the column attribute : the file attribute to be displayed in the column label : the user-visible label for the column description : a user-visible description of the column Creates a new Nemo.Column object.
nemo-python-3.6.0+sylvia/docs/reference/nemo-python-file-info.xml0000644000175000017500000004132513173636707023777 0ustar fabiofabio Nemo.FileInfo Nemo.FileInfo Reference Synopsis Nemo.FileInfo gobject.GInterface is_gone get_file_type get_location get_name get_uri get_activation_uri get_parent_info get_parent_location get_parent_uri get_mount get_uri_scheme get_mime_type is_mime_type mime_type is_directory can_write add_emblem emblem_name get_string_attribute attribute_name add_string_attribute attribute_name value invalidate_extension_info Ancestry +-- gobject.GInterface +-- Nemo.FileInfo Description Nemo.FileInfo objects are passed to extensions by the Nemo.InfoProvider. Public Methods Nemo.FileInfo.is_gone is_gone Returns : whether the file still exists Nemo.FileInfo.get_file_type get_file_type Returns : the gio.FileType associated with the file Nemo.FileInfo.get_location get_location Returns : the gio.File associated with the file Nemo.FileInfo.get_name get_name Returns : the basename of the file Nemo.FileInfo.get_uri get_uri Returns : the uri of the file Nemo.FileInfo.get_activation_uri get_activation_uri Returns : the activation uri of the file Nemo.FileInfo.get_parent_info get_parent_info Returns : the Nemo.FileInfo object associated with the file's parent Nemo.FileInfo.get_parent_location get_parent_location Returns : the gio.File associated with the file's parent location Nemo.FileInfo.get_parent_uri get_parent_uri Returns : the uri of the file's parent Nemo.FileInfo.get_mount get_mount Returns : the gio.GMount associated with the file, if it exists Nemo.FileInfo.get_uri_scheme get_uri_scheme Returns : the uri scheme of the file Nemo.FileInfo.get_mime_type get_mime_type Returns : the mimetype of the file Nemo.FileInfo.is_mime_type is_mime_type mimetype mimetype : a mimetype string (i.e. "text/plain") Returns : whether the file's mimetype string matches the provided mimetype string Nemo.FileInfo.is_directory is_directory Returns : whether the item is a directory Nemo.FileInfo.can_write can_write Returns : whether the file is writeable Nemo.FileInfo.add_emblem add_emblem emblem_name emblem_name : the name of an emblem to add Nemo.FileInfo.get_string_attribute get_string_attribute attribute_name attribute_name : a string attribute name Returns : the value associated with the file attribute Nemo.FileInfo.add_string_attribute add_string_attribute attribute_name value attribute_name : a string attribute name value : an attribute value Nemo.FileInfo.invalidate_extension_info invalidate_extension_info Invalidates the information Nemo has about this file, which causes it to request new information from its Nemo.InfoProvider providers. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-overview-example.xml0000644000175000017500000000376313173636707025432 0ustar fabiofabio A Simple Extension Create an empty file with the following code: A Simple Extension from gi.repository import Nemo, GObject class ColumnExtension(GObject.GObject, Nemo.MenuProvider): def __init__(self): pass def menu_activate_cb(self, menu, file): print "menu_activate_cb",file def get_file_items(self, window, files): if len(files) != 1: return file = files[0] item = Nemo.MenuItem( name="SimpleMenuExtension::Show_File_Name", label="Showing %s" % file.get_name(), tip="Showing %s" % file.get_name() ) item.connect('activate', self.menu_activate_cb, file) return [item] Save this file as TestExtension.py in the ~/.local/share/nemo-python/extensions folder. You may need to create this folder. To run, simply restart Nemo. Once Nemo restarts, right-click on a file and you should see a new menu item, "Showing #filename#". It is as simple as that! As mentioned above, in order to get loaded by Nemo, a python extension must import the Nemo module from gi.repository, create a class derived from a nemo *Provider and a gobject.GObject, and create the methods that will be called by Nemo when it requests information from its providers. In this case, when someone right-clicks on a file, Nemo will ask all of its MenuProviders for additional menu items to show the user. When folders or files are clicked, the get_file_items method is called and a list of Nemo.MenuItems is expected. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-property-page.xml0000644000175000017500000001062013173636707024717 0ustar fabiofabio Nemo.PropertyPage Nemo.PropertyPage Reference Synopsis Nemo.PropertyPage gobject.GObject Nemo.PropertyPage name label page Ancestry +-- gobject.GObject +-- Nemo.PropertyPage Description A Nemo.PropertyPage object is returned by Nemo.PropertyPageProvider extensions. Properties
"label" The label widget displayed in the notebook tab. Read-Write "name" The name of the page. Default value: None Read-Write-ConstructOnly "page" The property page widget Read-Write
Constructor Nemo.PropertyPage name label page name : identifier of the property page label : the user-visible label for the property page page : the property page widget Creates a new Nemo.PropertyPage object.
nemo-python-3.6.0+sylvia/docs/reference/nemo-python-operation-result.xml0000644000175000017500000000430013173636707025433 0ustar fabiofabio Nemo.OperationResult Nemo.OperationResult Reference Description The Nemo.OperationResult constants are used by the Nemo.InfoProvider provider to notify Nemo what the extension intends to do when Nemo calls the extension's update_file_info_full method. The possible values are as follows: Nemo.OperationResult.COMPLETE The operation is complete and Nemo can move on to the next update_file_info_full call. Nemo.OperationResult.IN_PROGRESS The operation is in progress and running asynchronously and Nemo should wait until the Nemo.info_provider_update_complete_invoke method is called before moving on to the next update_file_info_full call. Nemo.OperationResult.FAILED The operation has failed. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-property-page-provider.xml0000644000175000017500000001015713173636707026554 0ustar fabiofabio Nemo.PropertyPageProvider Nemo.PropertyPageProvider Reference Synopsis Nemo.PropertyPageProvider get_pages files Description If subclassed, Nemo will request a list of custom property pages that should appear when a user opens the Properties dialog for a file or folder. Nemo.PropertyPageProvider Example import hashlib import urllib from gi.repository import Nemo, GObject, Gtk class ColumnExtension(GObject.GObject, Nemo.PropertyPageProvider): def __init__(self): pass def get_property_pages(self, files): if len(files) != 1: return file = files[0] if file.get_uri_scheme() != 'file': return if file.is_directory(): return filename = urllib.unquote(file.get_uri()[7:]) self.property_label = Gtk.Label('MD5Sum') self.property_label.show() self.hbox = Gtk.HBox(homogeneous=False, spacing=0) self.hbox.show() label = Gtk.Label('MD5Sum:') label.show() self.hbox.pack_start(label, False, False, 0) self.value_label = Gtk.Label() self.hbox.pack_start(self.value_label, False, False, 0) md5sum = hashlib.md5() with open(filename,'rb') as f: for chunk in iter(lambda: f.read(8192), ''): md5sum.update(chunk) f.close() self.value_label.set_text(md5sum.hexdigest()) self.value_label.show() return Nemo.PropertyPage(name="NemoPython::md5_sum", label=self.property_label, page=self.hbox), Passive Methods Nemo.PropertyPageProvider.get_pages get_pages files : a list of Nemo.FileInfo objects. Returns : a list of Nemo.PropertyPage objects This function is called by Nemo when it wants property page items from the extension. It is called in the main thread before a property page is shown, so it should return quickly. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-location-widget-provider.xml0000644000175000017500000000666413173636707027057 0ustar fabiofabio Nemo.LocationWidgetProvider Nemo.LocationWidgetProvider Reference Synopsis Nemo.LocationWidgetProvider get_widget uri window Description If subclassed, Nemo will request a widget to be displayed at the top of the directory listing. Nemo.LocationWidgetProvider Example from gi.repository import Nemo, GObject, Gtk class ColumnExtension(GObject.GObject, Nemo.LocationWidgetProvider): def __init__(self): pass def get_widget(self, uri, window): entry = Gtk.Entry() entry.set_text(uri) entry.show() return entry Passive Methods Nemo.LocationWidgetProvider.get_widget get_widget uri window uri : the current folder uri window : the current gtk.Window instance Returns : a gtk.Widget object This function is called by Nemo when it wants a location widget from the extension. It is called in the main thread before a directory listing is shown, so it should return quickly. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-info-provider.xml0000644000175000017500000003135513173636707024714 0ustar fabiofabio Nemo.InfoProvider Nemo.InfoProvider Reference Synopsis Nemo.InfoProvider update_file_info file update_file_info_full provider handle closure file cancel_update provider handle Nemo.info_provider_update_complete_invoke provider handle closure resultNemo.OperationResult.COMPLETE Description If subclassed, Nemo will call update_file_info(_full) to notify extensions of which files are being viewed by the user. This gives extensions an opportunity to invoke actions on the files, or to add emblems or attributes. Nemo.InfoProvider Example from gi.repository import Nemo, GObject class ColumnExtension(GObject.GObject, Nemo.InfoProvider): def __init__(self): pass def update_file_info_full(self, provider, handle, closure, file): gobject.timeout_add_seconds(3, self.update_cb, provider, handle, closure) return Nemo.OperationResult.IN_PROGRESS def update_cb(self, provider, handle, closure): Nemo.info_provider_update_complete_invoke(closure, provider, handle, Nemo.OperationResult.FAILED) Passive Methods Nemo.InfoProvider.update_file_info update_file_info file file : a Nemo.FileInfo object This method is called by Nemo for each file or folder that exists under the current directory listing. There is no return value. Nemo.InfoProvider.update_file_info_full update_file_info_full provider handle closure file provider : the current Nemo.InfoProvider instance handle : a gobject.gpointer generated solely to track this call closure : a C Closure that must be passed to Nemo.info_provider_update_complete_invoke if that method is called file : a Nemo.FileInfo object Returns : None or a Nemo.OperationResult enum This method is called by Nemo for each file or folder that exists under the current directory listing. Originally, Nemo.InfoProvider only provided the update_file_info method, which blocked Nemo when the method required a lot of computation time. This method was created to allow an extension to tell Nemo that it will be spending time on an operation and that Nemo should not block itself during that time. In order to notify Nemo of your extension's intentions, you must return a Nemo.OperationResult enum. Then, when the operation has completed, call the Nemo.info_provider_update_complete_invoke method, passing the provider, handle and closure variables as parameters. This method was created for backwards compatibility reasons. If your extension used the update_file_info method and you want non-blocking usage, you should switch to this method. This method was introduced in nemo-python 0.7.0. Nemo.InfoProvider.cancel_update cancel_update provider handle provider : the current Nemo.InfoProvider instance handle : a gobject.gpointer generated by a specific update_file_info_full call This method is called by Nemo when an update_file_info_full call is in progress but is no longer required. This may happen because the user is moving directories or a file has been deleted, etc. You may use the handle parameter here to match the handle parameter passed in update_file_info_full. This method was introduced in nemo-python 0.7.0. Active Methods Nemo.info_provider_update_complete_invoke info_provider_update_complete_invoke provider handle closure resultNemo.OperationResult.COMPLETE provider : the current Nemo.InfoProvider instance handle : a gobject.gpointer generated by a specific update_file_info_full call closure : a C Closure that must be passed to Nemo.info_provider_update_complete_invoke if that method is called result : an optional parameter. If left out, Nemo.OperationResult.COMPLETE is assumed. Otherwise, you may pass any any of the Nemo.OperationResult enums. An extension must call this method for each update_file_info_full method that returns the Nemo.OperationResult.IN_PROGRESS enum. The method must be called with the provider, handle, and closure parameters which were passed to the earlier update_file_info_full method. This method was introduced in nemo-python 0.7.0. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-overview.xml0000644000175000017500000000475613173636707024004 0ustar fabiofabio Overview Writing a Nemo-Python extension is a fairly straight-forward process. One simply imports the Nemo module from the gobject introspection repository and creates a class which is derived from a gobject.GObject and one of the Nemo module's classes. When an extension derives a class, it becomes a "provider", telling Nemo to ask it for information. There are several types of providers available for extensions to use: there is MenuProvider, LocationWidgetProvider, ColumnProvider, PropertyPageProvider, and InfoProvider, all of which will be explained in more detail below. Your class can be derived from multiple providers. Here are the basic steps: 1. A script is written and installed to the standard nemo-python extension install path 2. Nemo is (re)started and loads the nemo-python C extension, which in turn loads all python extensions it can find 3. Any python script in the standard nemo-python extension install path that imports the Nemo module from the gobject introspection repository and derives the main class from a Nemo module class will be loaded A note about the standard python extensions install path As of nemo-python 0.7.0 (and continued in 1.0+), nemo-python looks in ~/.local/share/nemo-python/extensions for local extensions and $PREFIX/share/nemo-python/extensions for global extensions. A note about compatibility issues for nemo-python 1.0 1. We no longer support the "import nemo" command that previous versions used. This is because nemo-python now directly uses Nemo's annotations, which must be imported by the "from gi.repository import Nemo" command. 2. The extension class must now derive itself from a gobject.GObject in addition to the standard Nemo classes. 3. For now, some Nemo class constructors require passing named arguments instead of a standard argument list. This requirement may go away at some point. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-menu.xml0000644000175000017500000000747713173636707023105 0ustar fabiofabio Nemo.Menu Nemo.Menu Reference Synopsis Nemo.Menu gobject.GObject Nemo.Menu append_item item get_items Ancestry +-- gobject.GObject +-- Nemo.Menu Description A Nemo.Menu object allows an extension to create sub-menus. Constructor Nemo.Menu Creates a new Nemo.Menu object. Public Methods Nemo.Menu.append_item append_item item item : a Nemo.MenuItem Append a Nemo.MenuItem to a Nemo.Menu. Nemo.Menu.get_items get_items Returns a list of Nemo.MenuItem objects attached to the Nemo.Menu. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-provider-reference.xml0000644000175000017500000000113613173636707025711 0ustar fabiofabio Provider Interfaces nemo-python-3.6.0+sylvia/docs/reference/nemo-python-column-provider.xml0000644000175000017500000000675713173636707025266 0ustar fabiofabio Nemo.ColumnProvider Nemo.ColumnProvider Reference Synopsis Nemo.ColumnProvider get_columns Description If subclassed, Nemo will request a list of Nemo.Column objects, which are then displayed when the user is in List mode. An extension sub-classing Nemo.ColumnProvider will almost always want to sub-class Nemo.InfoProvider as well, since that is how an extension provides information for each item in a directory listing. Nemo.ColumnProvider Example import os import urllib from gi.repository import Nemo, GObject class ColumnExtension(GObject.GObject, Nemo.ColumnProvider, Nemo.InfoProvider): def __init__(self): pass def get_columns(self): return Nemo.Column(name="NemoPython::block_size_column", attribute="block_size", label="Block size", description="Get the block size"), def update_file_info(self, file): if file.get_uri_scheme() != 'file': return filename = urllib.unquote(file.get_uri()[7:]) file.add_string_attribute('block_size', str(os.stat(filename).st_blksize)) Passive Methods Nemo.ColumnProvider.get_columns get_columns Returns : a list of Nemo.Column The get_columns() method returns a list of Nemo.Column. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-menu-provider.xml0000644000175000017500000003617013173636707024725 0ustar fabiofabio Nemo.MenuProvider Nemo.MenuProvider Reference Synopsis Nemo.MenuProvider get_file_items window files get_file_items_full provider window files get_background_items window folder get_background_items_full provider window folder Nemo.menu_provider_emit_items_updated_signal provider Description If subclassed, Nemo will request a list of Nemo.MenuItem objects, which are then attached to various menus. Nemo expects at least one of the following methods to be defined (or their *_full variants): get_file_items or get_background_items. The get_toolbar_items methods were removed in nemo-python 1.0 because they were removed from Nemo 3. Technically, you should still be able to call those methods with nemo-python 1.0 if you are running Nemo 2.x with annotations. Nemo.MenuProvider Example from gi.repository import Nemo, GObject class ColumnExtension(GObject.GObject, Nemo.MenuProvider): def __init__(self): pass def get_file_items(self, window, files): top_menuitem = Nemo.MenuItem(name='ExampleMenuProvider::Foo', label='Foo', tip='', icon='') submenu = Nemo.Menu() top_menuitem.set_submenu(submenu) sub_menuitem = Nemo.MenuItem(name='ExampleMenuProvider::Bar', label='Bar', tip='', icon='') submenu.append_item(sub_menuitem) return top_menuitem, def get_background_items(self, window, file): submenu = Nemo.Menu() submenu.append_item(Nemo.MenuItem(name='ExampleMenuProvider::Bar2', label='Bar2', tip='', icon='')) menuitem = Nemo.MenuItem(name='ExampleMenuProvider::Foo2', label='Foo2', tip='', icon='') menuitem.set_submenu(submenu) return menuitem, Signals "items-updated" callback Passive Methods Nemo.MenuProvider.get_file_items get_file_items window files window : the current gtk.Window instance menu : a list of Nemo.FileInfo objects. Returns : a list of Nemo.MenuItem objects The get_file_items() method returns a list of Nemo.MenuItem objects. Nemo.MenuProvider.get_file_items_full get_file_items_full provider window files provider : the current Nemo.MenuProvider instance window : the current gtk.Window instance files : a list of Nemo.FileInfo objects. Returns : a list of Nemo.MenuItem objects The get_file_items_full() method returns a list of Nemo.MenuItem objects. This method was created in order to allow extension writers to call the Nemo.menu_provider_emit_items_updated_signal, which must be passed the current provider instance. This method was introduced in nemo-python 0.7.0. Nemo.MenuProvider.get_background_items get_background_items window folder window : the current gtk.Window instance folder : the current folder, as a Nemo.FileInfo object. Returns : a list of Nemo.MenuItem objects The get_background_items() method returns a list of Nemo.MenuItem objects. Nemo.MenuProvider.get_background_items_full get_background_items_full provider window folder provider : the current Nemo.MenuProvider instance window : the current gtk.Window instance folder : the current folder, as a Nemo.FileInfo object. Returns : a list of Nemo.MenuItem objects The get_background_items_full() method returns a list of Nemo.MenuItem objects. This method was created in order to allow extension writers to call the Nemo.menu_provider_emit_items_updated_signal, which must be passed the current provider instance. This method was introduced in nemo-python 0.7.0. Active Methods Nemo.menu_provider_emit_items_updated_signal menu_provider_emit_items_updated_signal provider provider : the current Nemo.MenuProvider instance Emits the "items-updated" signal. This method was introduced in nemo-python 0.7.0. Signal Details The "items-updated" Nemo.MenuProvider Signal Emits the "items-updated" signal. nemo-python-3.6.0+sylvia/docs/reference/nemo-python-overview-methods.xml0000644000175000017500000000236413173636707025436 0ustar fabiofabio Explanation of Passive/Active Methods Because nemo-python is an interface to a Nemo' extension interface rather than a true library, it is rather quirky in how it works. One example of this is that several providers have additional public methods that an extension actively calls, rather than the extension defining and the method in their class that is called by Nemo. You can see this with the Nemo.menu_provider_emit_items_updated_signal and Nemo.info_provider_update_complete_invoke methods, which the extension actively calls, passing the provider instance as a parameter. Due to this confusion, I have termed these actively-called methods Active Methods and the methods called by Nemo are termed Passive Methods. nemo-python-3.6.0+sylvia/docs/Makefile.am0000644000175000017500000000563713173636707017236 0ustar fabiofabioBUILDDIR = $(top_builddir)/docs REF_VERSION = $(VERSION) FULL_VERSION = $(VERSION) FIXXREF = $(srcdir)/xsl/fixxref.py HTML_STYLE = $(srcdir)/xsl/ref-html-style.xsl XML_FILES = \ reference/nemo-python-ref.xml \ reference/nemo-python-overview.xml \ reference/nemo-python-overview-example.xml \ reference/nemo-python-overview-methods.xml \ reference/nemo-python-class-reference.xml \ reference/nemo-python-provider-reference.xml \ reference/nemo-python-column.xml \ reference/nemo-python-column-provider.xml \ reference/nemo-python-menu.xml \ reference/nemo-python-menu-item.xml \ reference/nemo-python-menu-provider.xml \ reference/nemo-python-property-page.xml \ reference/nemo-python-property-page-provider.xml \ reference/nemo-python-location-widget-provider.xml \ reference/nemo-python-file-info.xml \ reference/nemo-python-info-provider.xml \ reference/nemo-python-enum-reference.xml \ reference/nemo-python-operation-result.xml HTMLdir = $(datadir)/gtk-doc/html/nemo-python HTML_FILES = \ html/index.html \ html/index.sgml \ html/nemo-python-overview.html \ html/nemo-python-overview-example.html \ html/nemo-python-overview-methods.html \ html/nemo-python-class-reference.html \ html/nemo-python-provider-reference.html \ html/class-nemo-python-column.html \ html/class-nemo-python-column-provider.html \ html/class-nemo-python-menu.html \ html/class-nemo-python-menu-item.html \ html/class-nemo-python-menu-provider.html \ html/class-nemo-python-property-page.html \ html/class-nemo-python-property-page-provider.html \ html/class-nemo-python-location-widget-provider.html \ html/class-nemo-python-file-info.html \ html/class-nemo-python-info-provider.html \ html/nemo-python-enum-reference.html \ html/enum-nemo-python-operation-result.html \ html/nemo-python.devhelp HTML_DATA = $(HTMLFILES) XSL_FILES = \ xsl/common.xsl \ xsl/devhelp.xsl \ xsl/html.xsl \ xsl/pdf-style.xsl \ xsl/pdf.xsl \ xsl/style.css XSL_DATA = $(XSL_FILES) $(FIXXREF) XSLdir = $(BUILDDIR)/xsl CSS_FILES = xsl/style.css CSSdir = $(HTMLdir) CSS_DATA = $(CSS_FILES) BUILT_SOURCES = \ reference/builddate.xml \ $(HTML_FILES) CLEANFILES = \ nemo-python-ref.* \ reference/builddate.xml \ $(HTML_FILES) EXTRA_DIST = \ $(XML_FILES) \ $(XSL_FILES) \ $(FIXXREF) \ $(HTML_STYLE) REFERENCE_DEPS = \ reference \ $(XML_FILES) \ $(XSL_FILES) \ $(FIXXREF) if ENABLE_GTK_DOC reference/builddate.xml: $(REFERENCE_DEPS) $(PYTHON) -c 'import datetime; print datetime.date.today()' > $@ $(HTML_FILES): $(REFERENCE_DEPS) xsltproc --nonet --xinclude -o $(BUILDDIR)/html/ \ --path $(BUILDDIR)/reference:$(srcdir)/reference \ --stringparam gtkdoc.bookname "nemo-python" \ --stringparam gtkdoc.version ${REF_VERSION} \ $(HTML_STYLE) $(srcdir)/reference/nemo-python-ref.xml $(FIXXREF) -i xsl $(BUILDDIR)/html touch $@ endif nemo-python-3.6.0+sylvia/src/0000755000175000017500000000000013173636707015026 5ustar fabiofabionemo-python-3.6.0+sylvia/src/nemo-python.c0000644000175000017500000001624113173636707017453 0ustar fabiofabio/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * Copyright (C) 2004,2005 Johan Dahlin * * 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, 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 St, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include "nemo-python.h" #include "nemo-python-object.h" #include static const GDebugKey nemo_python_debug_keys[] = { {"misc", NEMO_PYTHON_DEBUG_MISC}, }; static const guint nemo_python_ndebug_keys = sizeof (nemo_python_debug_keys) / sizeof (GDebugKey); NemoPythonDebug nemo_python_debug; static gboolean nemo_python_init_python(void); static GArray *all_types = NULL; static inline gboolean np_init_pygobject(void) { PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION); if (gobject == NULL) { PyErr_Print (); return FALSE; } return TRUE; } static void nemo_python_load_file(GTypeModule *type_module, const gchar *filename) { PyObject *main_module, *main_locals, *locals, *key, *value; PyObject *module; GType gtype; Py_ssize_t pos = 0; debug_enter_args("filename=%s", filename); main_module = PyImport_AddModule("__main__"); if (main_module == NULL) { g_warning("Could not get __main__."); return; } main_locals = PyModule_GetDict(main_module); module = PyImport_ImportModuleEx((char *) filename, main_locals, main_locals, NULL); if (!module) { PyErr_Print(); return; } locals = PyModule_GetDict(module); while (PyDict_Next(locals, &pos, &key, &value)) { if (!PyType_Check(value)) continue; if (PyObject_IsSubclass(value, (PyObject*)&PyNemoColumnProvider_Type) || PyObject_IsSubclass(value, (PyObject*)&PyNemoInfoProvider_Type) || PyObject_IsSubclass(value, (PyObject*)&PyNemoLocationWidgetProvider_Type) || PyObject_IsSubclass(value, (PyObject*)&PyNemoMenuProvider_Type) || PyObject_IsSubclass(value, (PyObject*)&PyNemoPropertyPageProvider_Type)) { gtype = nemo_python_object_get_type(type_module, value); g_array_append_val(all_types, gtype); } } debug("Loaded python modules"); } static void nemo_python_load_dir (GTypeModule *module, const char *dirname) { GDir *dir; const char *name; gboolean initialized = FALSE; debug_enter_args("dirname=%s", dirname); dir = g_dir_open(dirname, 0, NULL); if (!dir) return; while ((name = g_dir_read_name(dir))) { if (g_str_has_suffix(name, ".py")) { char *modulename; int len; len = strlen(name) - 3; modulename = g_new0(char, len + 1 ); strncpy(modulename, name, len); if (!initialized) { PyObject *sys_path, *py_path; /* n-p python part is initialized on demand (or not * at all if no extensions are found) */ if (!nemo_python_init_python()) { g_warning("nemo_python_init_python failed"); g_dir_close(dir); break; } /* sys.path.insert(0, dirname) */ sys_path = PySys_GetObject("path"); py_path = PyString_FromString(dirname); PyList_Insert(sys_path, 0, py_path); Py_DECREF(py_path); } nemo_python_load_file(module, modulename); } } } static gboolean nemo_python_init_python (void) { PyObject *gi, *require_version, *args, *nemo; GModule *libpython; char *argv[] = { "nemo", NULL }; if (Py_IsInitialized()) return TRUE; debug("g_module_open " PY_LIB_LOC "/libpython" PYTHON_VERSION "." G_MODULE_SUFFIX ".1.0"); libpython = g_module_open(PY_LIB_LOC "/libpython" PYTHON_VERSION "." G_MODULE_SUFFIX ".1.0", 0); if (!libpython) g_warning("g_module_open libpython failed: %s", g_module_error()); debug("Py_Initialize"); Py_Initialize(); if (PyErr_Occurred()) { PyErr_Print(); return FALSE; } debug("PySys_SetArgv"); PySys_SetArgv(1, argv); if (PyErr_Occurred()) { PyErr_Print(); return FALSE; } debug("Sanitize the python search path"); PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)"); if (PyErr_Occurred()) { PyErr_Print(); return FALSE; } /* import gobject */ debug("init_pygobject"); if (!np_init_pygobject()) { g_warning("pygobject initialization failed"); return FALSE; } /* import nemo */ g_setenv("INSIDE_NEMO_PYTHON", "", FALSE); debug("import nemo"); gi = PyImport_ImportModule ("gi"); if (!gi) { g_critical ("can't find gi"); return FALSE; } require_version = PyObject_GetAttrString (gi, (char *) "require_version"); args = PyTuple_Pack (2, PyUnicode_FromString ("Nemo"), PyUnicode_FromString ("3.0")); PyObject_CallObject (require_version, args); Py_DECREF (require_version); Py_DECREF (args); Py_DECREF (gi); nemo = PyImport_ImportModule("gi.repository.Nemo"); if (!nemo) { PyErr_Print(); return FALSE; } _PyGtkWidget_Type = pygobject_lookup_class(GTK_TYPE_WIDGET); g_assert(_PyGtkWidget_Type != NULL); #define IMPORT(x, y) \ _PyNemo##x##_Type = (PyTypeObject *)PyObject_GetAttrString(nemo, y); \ if (_PyNemo##x##_Type == NULL) { \ PyErr_Print(); \ return FALSE; \ } IMPORT(Column, "Column"); IMPORT(ColumnProvider, "ColumnProvider"); IMPORT(InfoProvider, "InfoProvider"); IMPORT(LocationWidgetProvider, "LocationWidgetProvider"); IMPORT(Menu, "Menu"); IMPORT(MenuItem, "MenuItem"); IMPORT(MenuProvider, "MenuProvider"); IMPORT(PropertyPage, "PropertyPage"); IMPORT(PropertyPageProvider, "PropertyPageProvider"); IMPORT(NameAndDescProvider, "NameAndDescProvider"); IMPORT(OperationHandle, "OperationHandle"); #undef IMPORT return TRUE; } void nemo_module_initialize(GTypeModule *module) { gchar *user_extensions_dir; const gchar *env_string; env_string = g_getenv("NEMO_PYTHON_DEBUG"); if (env_string != NULL) { nemo_python_debug = g_parse_debug_string(env_string, nemo_python_debug_keys, nemo_python_ndebug_keys); env_string = NULL; } debug_enter(); all_types = g_array_new(FALSE, FALSE, sizeof(GType)); // Look in the new global path, $DATADIR/nemo-python/extensions nemo_python_load_dir(module, DATADIR "/nemo-python/extensions"); // Look in XDG_DATA_DIR, ~/.local/share/nemo-python/extensions user_extensions_dir = g_build_filename(g_get_user_data_dir(), "nemo-python", "extensions", NULL); nemo_python_load_dir(module, user_extensions_dir); } void nemo_module_shutdown(void) { debug_enter(); if (Py_IsInitialized()) Py_Finalize(); g_array_free(all_types, TRUE); } void nemo_module_list_types(const GType **types, int *num_types) { debug_enter(); *types = (GType*)all_types->data; *num_types = all_types->len; } nemo-python-3.6.0+sylvia/src/nemo-python-object.h0000644000175000017500000000246613173636707020730 0ustar fabiofabio/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * Copyright (C) 2004,2005 Johan Dahlin * * 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, 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 St, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef NEMO_PYTHON_OBJECT_H #define NEMO_PYTHON_OBJECT_H #include #include G_BEGIN_DECLS typedef struct _NemoPythonObject NemoPythonObject; typedef struct _NemoPythonObjectClass NemoPythonObjectClass; struct _NemoPythonObject { GObject parent_slot; PyObject *instance; }; struct _NemoPythonObjectClass { GObjectClass parent_slot; PyObject *type; }; GType nemo_python_object_get_type (GTypeModule *module, PyObject *type); G_END_DECLS #endif nemo-python-3.6.0+sylvia/src/nemo-python.h0000644000175000017500000000555613173636707017467 0ustar fabiofabio/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * Copyright (C) 2004,2005 Johan Dahlin * * 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, 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 St, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef NEMO_PYTHON_H #define NEMO_PYTHON_H #include #include #include #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #endif typedef enum { NEMO_PYTHON_DEBUG_MISC = 1 << 0, } NemoPythonDebug; extern NemoPythonDebug nemo_python_debug; #define debug(x) { if (nemo_python_debug & NEMO_PYTHON_DEBUG_MISC) \ g_printf( "nemo-python:" x "\n"); } #define debug_enter() { if (nemo_python_debug & NEMO_PYTHON_DEBUG_MISC) \ g_printf("%s: entered\n", __FUNCTION__); } #define debug_enter_args(x, y) { if (nemo_python_debug & NEMO_PYTHON_DEBUG_MISC) \ g_printf("%s: entered " x "\n", __FUNCTION__, y); } PyTypeObject *_PyGtkWidget_Type; #define PyGtkWidget_Type (*_PyGtkWidget_Type) PyTypeObject *_PyNemoColumn_Type; #define PyNemoColumn_Type (*_PyNemoColumn_Type) PyTypeObject *_PyNemoColumnProvider_Type; #define PyNemoColumnProvider_Type (*_PyNemoColumnProvider_Type) PyTypeObject *_PyNemoInfoProvider_Type; #define PyNemoInfoProvider_Type (*_PyNemoInfoProvider_Type) PyTypeObject *_PyNemoLocationWidgetProvider_Type; #define PyNemoLocationWidgetProvider_Type (*_PyNemoLocationWidgetProvider_Type) PyTypeObject *_PyNemoNameAndDescProvider_Type; #define PyNemoNameAndDescProvider_Type (*_PyNemoNameAndDescProvider_Type) PyTypeObject *_PyNemoMenu_Type; #define PyNemoMenu_Type (*_PyNemoMenu_Type) PyTypeObject *_PyNemoMenuItem_Type; #define PyNemoMenuItem_Type (*_PyNemoMenuItem_Type) PyTypeObject *_PyNemoMenuProvider_Type; #define PyNemoMenuProvider_Type (*_PyNemoMenuProvider_Type) PyTypeObject *_PyNemoPropertyPage_Type; #define PyNemoPropertyPage_Type (*_PyNemoPropertyPage_Type) PyTypeObject *_PyNemoPropertyPageProvider_Type; #define PyNemoPropertyPageProvider_Type (*_PyNemoPropertyPageProvider_Type) PyTypeObject *_PyNemoOperationHandle_Type; #define PyNemoOperationHandle_Type (*_PyNemoOperationHandle_Type) #endif /* NEMO_PYTHON_H */ nemo-python-3.6.0+sylvia/src/Makefile.am0000644000175000017500000000121513173636707017061 0ustar fabiofabioINCLUDES = \ -DG_LOG_DOMAIN=\"Nemo-Python\" \ -DDATADIR=\"$(datadir)\" \ -DLIBDIR=\"$(libdir)\" \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DISABLE_DEPRECATED_CFLAGS) \ $(NEMO_PYTHON_CFLAGS) \ -DPYTHON_VERSION=\"$(PYTHON_VERSION)\" \ -DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\"" \ $(PYTHON_INCLUDES) nemo_extensiondir=$(NEMO_EXTENSION_DIR) nemo_extension_LTLIBRARIES = libnemo-python.la libnemo_python_la_SOURCES = \ nemo-python.c \ nemo-python.h \ nemo-python-object.c \ nemo-python-object.h libnemo_python_la_LDFLAGS = -module -avoid-version libnemo_python_la_LIBADD = $(NEMO_PYTHON_LIBS) $(PYTHON_LIBS) nemo-python-3.6.0+sylvia/src/nemo-python-object.c0000644000175000017500000004504513173636707020723 0ustar fabiofabio/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * Copyright (C) 2004,2005 Johan Dahlin * * 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, 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 St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "nemo-python-object.h" #include "nemo-python.h" #include #include /* Nemo extension headers */ #include #include #include #include #include #include #include #include #include #define METHOD_PREFIX "" static GObjectClass *parent_class; /* These macros assumes the following things: * a METHOD_NAME is defined with is a string * a goto label called beach * the return value is called ret */ #define CHECK_METHOD_NAME(self) \ if (!PyObject_HasAttrString(self, METHOD_NAME)) \ goto beach; #define CHECK_OBJECT(object) \ if (object->instance == NULL) \ { \ g_object_unref (object); \ goto beach; \ } \ #define CONVERT_LIST(py_files, files) \ { \ GList *l; \ py_files = PyList_New(0); \ for (l = files; l; l = l->next) \ { \ PyList_Append(py_files, pygobject_new((GObject*)l->data)); \ } \ } #define HANDLE_RETVAL(py_ret) \ if (!py_ret) \ { \ PyErr_Print(); \ goto beach; \ } \ else if (py_ret == Py_None) \ { \ goto beach; \ } #define HANDLE_LIST(py_ret, type, type_name) \ { \ Py_ssize_t i = 0; \ if (!PySequence_Check(py_ret) || PyString_Check(py_ret)) \ { \ PyErr_SetString(PyExc_TypeError, \ METHOD_NAME " must return a sequence"); \ goto beach; \ } \ for (i = 0; i < PySequence_Size (py_ret); i++) \ { \ PyGObject *py_item; \ py_item = (PyGObject*)PySequence_GetItem (py_ret, i); \ if (!pygobject_check(py_item, &Py##type##_Type)) \ { \ PyErr_SetString(PyExc_TypeError, \ METHOD_NAME \ " must return a sequence of " \ type_name); \ goto beach; \ } \ ret = g_list_append (ret, (type*) g_object_ref(py_item->obj)); \ Py_DECREF(py_item); \ } \ } static void free_pygobject_data(gpointer data, gpointer user_data) { /* Some NemoFile objects are cached and not freed until nemo itself is closed. Since PyGObject stores data that must be freed by the Python interpreter, we must always free it before the interpreter is finalized. */ g_object_set_data((GObject *)data, "PyGObject::instance-data", NULL); } static void free_pygobject_data_list(GList *list) { if (list == NULL) return; g_list_foreach(list, (GFunc)free_pygobject_data, NULL); } static PyObject * nemo_python_boxed_new (PyTypeObject *type, gpointer boxed, gboolean free_on_dealloc) { PyGBoxed *self = (PyGBoxed *) type->tp_alloc (type, 0); self->gtype = pyg_type_from_object ( (PyObject *) type); self->boxed = boxed; self->free_on_dealloc = free_on_dealloc; return (PyObject *) self; } #define METHOD_NAME "get_name_and_desc" static GList * nemo_python_object_get_name_and_desc (NemoNameAndDescProvider *provider) { NemoPythonObject *object = (NemoPythonObject*)provider; PyObject *py_ret = NULL; GList *ret = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); CHECK_METHOD_NAME(object->instance); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, NULL); HANDLE_RETVAL(py_ret); int i; for (i = 0; i < PySequence_Size (py_ret); i++) { PyObject *py_item; py_item = PySequence_GetItem (py_ret, i); if (!PyString_Check(py_item)) { PyErr_SetString(PyExc_TypeError, METHOD_NAME " must return a sequence of strings"); goto beach; } ret = g_list_append (ret, (gchar *) PyString_AsString(py_item)); Py_DECREF(py_item); } beach: Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; } #undef METHOD_NAME static void nemo_python_object_name_and_desc_provider_iface_init (NemoNameAndDescProviderIface *iface) { iface->get_name_and_desc = nemo_python_object_get_name_and_desc; } #define METHOD_NAME "get_property_pages" static GList * nemo_python_object_get_property_pages (NemoPropertyPageProvider *provider, GList *files) { NemoPythonObject *object = (NemoPythonObject*)provider; PyObject *py_files, *py_ret = NULL; GList *ret = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); CHECK_METHOD_NAME(object->instance); CONVERT_LIST(py_files, files); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(N)", py_files); HANDLE_RETVAL(py_ret); HANDLE_LIST(py_ret, NemoPropertyPage, "Nemo.PropertyPage"); beach: Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; } #undef METHOD_NAME static void nemo_python_object_property_page_provider_iface_init (NemoPropertyPageProviderIface *iface) { iface->get_pages = nemo_python_object_get_property_pages; } #define METHOD_NAME "get_widget" static GtkWidget * nemo_python_object_get_widget (NemoLocationWidgetProvider *provider, const char *uri, GtkWidget *window) { NemoPythonObject *object = (NemoPythonObject*)provider; GtkWidget *ret = NULL; PyObject *py_ret = NULL; PyGObject *py_ret_gobj; PyObject *py_uri = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); CHECK_METHOD_NAME(object->instance); py_uri = PyString_FromString(uri); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", py_uri, pygobject_new((GObject *)window)); HANDLE_RETVAL(py_ret); py_ret_gobj = (PyGObject *)py_ret; if (!pygobject_check(py_ret_gobj, &PyGtkWidget_Type)) { PyErr_SetString(PyExc_TypeError, METHOD_NAME "should return a gtk.Widget"); goto beach; } ret = (GtkWidget *)g_object_ref(py_ret_gobj->obj); beach: Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; } #undef METHOD_NAME static void nemo_python_object_location_widget_provider_iface_init (NemoLocationWidgetProviderIface *iface) { iface->get_widget = nemo_python_object_get_widget; } #define METHOD_NAME "get_file_items" static GList * nemo_python_object_get_file_items (NemoMenuProvider *provider, GtkWidget *window, GList *files) { NemoPythonObject *object = (NemoPythonObject*)provider; GList *ret = NULL; PyObject *py_ret = NULL, *py_files; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); if (PyObject_HasAttrString(object->instance, "get_file_items_full")) { CONVERT_LIST(py_files, files); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_file_items_full", "(NNN)", pygobject_new((GObject *)provider), pygobject_new((GObject *)window), py_files); } else if (PyObject_HasAttrString(object->instance, "get_file_items")) { CONVERT_LIST(py_files, files); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", pygobject_new((GObject *)window), py_files); } else { goto beach; } HANDLE_RETVAL(py_ret); HANDLE_LIST(py_ret, NemoMenuItem, "Nemo.MenuItem"); beach: free_pygobject_data_list(files); Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; } #undef METHOD_NAME #define METHOD_NAME "get_background_items" static GList * nemo_python_object_get_background_items (NemoMenuProvider *provider, GtkWidget *window, NemoFileInfo *file) { NemoPythonObject *object = (NemoPythonObject*)provider; GList *ret = NULL; PyObject *py_ret = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); if (PyObject_HasAttrString(object->instance, "get_background_items_full")) { py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_background_items_full", "(NNN)", pygobject_new((GObject *)provider), pygobject_new((GObject *)window), pygobject_new((GObject *)file)); } else if (PyObject_HasAttrString(object->instance, "get_background_items")) { py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", pygobject_new((GObject *)window), pygobject_new((GObject *)file)); } else { goto beach; } HANDLE_RETVAL(py_ret); HANDLE_LIST(py_ret, NemoMenuItem, "Nemo.MenuItem"); beach: free_pygobject_data(file, NULL); Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; } #undef METHOD_NAME static void nemo_python_object_menu_provider_iface_init (NemoMenuProviderIface *iface) { iface->get_background_items = nemo_python_object_get_background_items; iface->get_file_items = nemo_python_object_get_file_items; } #define METHOD_NAME "get_columns" static GList * nemo_python_object_get_columns (NemoColumnProvider *provider) { NemoPythonObject *object = (NemoPythonObject*)provider; GList *ret = NULL; PyObject *py_ret = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); \ debug_enter(); CHECK_OBJECT(object); CHECK_METHOD_NAME(object->instance); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, NULL); HANDLE_RETVAL(py_ret); HANDLE_LIST(py_ret, NemoColumn, "Nemo.Column"); beach: if (py_ret != NULL) Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; } #undef METHOD_NAME static void nemo_python_object_column_provider_iface_init (NemoColumnProviderIface *iface) { iface->get_columns = nemo_python_object_get_columns; } #define METHOD_NAME "cancel_update" static void nemo_python_object_cancel_update (NemoInfoProvider *provider, NemoOperationHandle *handle) { NemoPythonObject *object = (NemoPythonObject*)provider; PyObject *py_ret = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); PyObject *py_handle = nemo_python_boxed_new (_PyNemoOperationHandle_Type, handle, FALSE); debug_enter(); CHECK_OBJECT(object); CHECK_METHOD_NAME(object->instance); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", pygobject_new((GObject*)provider), py_handle); HANDLE_RETVAL(py_ret); beach: Py_XDECREF(py_ret); pyg_gil_state_release(state); } #undef METHOD_NAME #define METHOD_NAME "update_file_info" static NemoOperationResult nemo_python_object_update_file_info (NemoInfoProvider *provider, NemoFile *file, GClosure *update_complete, NemoOperationHandle **handle) { NemoPythonObject *object = (NemoPythonObject*)provider; NemoOperationResult ret = NEMO_OPERATION_COMPLETE; PyObject *py_ret = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); PyObject *py_handle = nemo_python_boxed_new (_PyNemoOperationHandle_Type, *handle, FALSE); debug_enter(); CHECK_OBJECT(object); if (PyObject_HasAttrString(object->instance, "update_file_info_full")) { py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "update_file_info_full", "(NNNN)", pygobject_new((GObject*)provider), py_handle, pyg_boxed_new(G_TYPE_CLOSURE, update_complete, TRUE, TRUE), pygobject_new((GObject*)file)); } else if (PyObject_HasAttrString(object->instance, "update_file_info")) { py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(N)", pygobject_new((GObject*)file)); } else { goto beach; } HANDLE_RETVAL(py_ret); if (!PyInt_Check(py_ret)) { PyErr_SetString(PyExc_TypeError, METHOD_NAME " must return None or a int"); goto beach; } ret = PyInt_AsLong(py_ret); beach: free_pygobject_data(file, NULL); Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; } #undef METHOD_NAME static void nemo_python_object_info_provider_iface_init (NemoInfoProviderIface *iface) { iface->cancel_update = nemo_python_object_cancel_update; iface->update_file_info = nemo_python_object_update_file_info; } static void nemo_python_object_instance_init (NemoPythonObject *object) { NemoPythonObjectClass *class; debug_enter(); class = (NemoPythonObjectClass*)(((GTypeInstance*)object)->g_class); object->instance = PyObject_CallObject(class->type, NULL); if (object->instance == NULL) PyErr_Print(); } static void nemo_python_object_finalize (GObject *object) { debug_enter(); if (((NemoPythonObject *)object)->instance != NULL) Py_DECREF(((NemoPythonObject *)object)->instance); } static void nemo_python_object_class_init (NemoPythonObjectClass *class, gpointer class_data) { debug_enter(); parent_class = g_type_class_peek_parent (class); class->type = (PyObject*)class_data; G_OBJECT_CLASS (class)->finalize = nemo_python_object_finalize; } GType nemo_python_object_get_type (GTypeModule *module, PyObject *type) { GTypeInfo *info; const char *type_name; GType gtype; static const GInterfaceInfo property_page_provider_iface_info = { (GInterfaceInitFunc) nemo_python_object_property_page_provider_iface_init, NULL, NULL }; static const GInterfaceInfo location_widget_provider_iface_info = { (GInterfaceInitFunc) nemo_python_object_location_widget_provider_iface_init, NULL, NULL }; static const GInterfaceInfo menu_provider_iface_info = { (GInterfaceInitFunc) nemo_python_object_menu_provider_iface_init, NULL, NULL }; static const GInterfaceInfo column_provider_iface_info = { (GInterfaceInitFunc) nemo_python_object_column_provider_iface_init, NULL, NULL }; static const GInterfaceInfo info_provider_iface_info = { (GInterfaceInitFunc) nemo_python_object_info_provider_iface_init, NULL, NULL }; static const GInterfaceInfo nd_provider_iface_info = { (GInterfaceInitFunc) nemo_python_object_name_and_desc_provider_iface_init, NULL, NULL }; debug_enter_args("type=%s", PyString_AsString(PyObject_GetAttrString(type, "__name__"))); info = g_new0 (GTypeInfo, 1); info->class_size = sizeof (NemoPythonObjectClass); info->class_init = (GClassInitFunc)nemo_python_object_class_init; info->instance_size = sizeof (NemoPythonObject); info->instance_init = (GInstanceInitFunc)nemo_python_object_instance_init; info->class_data = type; Py_INCREF(type); type_name = g_strdup_printf("%s+NemoPython", PyString_AsString(PyObject_GetAttrString(type, "__name__"))); gtype = g_type_module_register_type (module, G_TYPE_OBJECT, type_name, info, 0); if (PyObject_IsSubclass(type, (PyObject*)&PyNemoPropertyPageProvider_Type)) { g_type_module_add_interface (module, gtype, NEMO_TYPE_PROPERTY_PAGE_PROVIDER, &property_page_provider_iface_info); } if (PyObject_IsSubclass(type, (PyObject*)&PyNemoLocationWidgetProvider_Type)) { g_type_module_add_interface (module, gtype, NEMO_TYPE_LOCATION_WIDGET_PROVIDER, &location_widget_provider_iface_info); } if (PyObject_IsSubclass(type, (PyObject*)&PyNemoMenuProvider_Type)) { g_type_module_add_interface (module, gtype, NEMO_TYPE_MENU_PROVIDER, &menu_provider_iface_info); } if (PyObject_IsSubclass(type, (PyObject*)&PyNemoColumnProvider_Type)) { g_type_module_add_interface (module, gtype, NEMO_TYPE_COLUMN_PROVIDER, &column_provider_iface_info); } if (PyObject_IsSubclass(type, (PyObject*)&PyNemoInfoProvider_Type)) { g_type_module_add_interface (module, gtype, NEMO_TYPE_INFO_PROVIDER, &info_provider_iface_info); } if (PyObject_IsSubclass(type, (PyObject*)&PyNemoNameAndDescProvider_Type)) { g_type_module_add_interface (module, gtype, NEMO_TYPE_NAME_AND_DESC_PROVIDER, &nd_provider_iface_info); } return gtype; } nemo-python-3.6.0+sylvia/configure.in0000644000175000017500000000572513173636707016561 0ustar fabiofabioAC_PREREQ(2.60) AC_INIT PACKAGE=nemo-python VERSION=3.6.0 AC_SUBST(PACKAGE) AC_SUBST(VERSION) AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AM_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR([m4]) AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .") NEMO_REQUIRED=1.0.3 AC_PROG_CC AC_DISABLE_STATIC AC_PROG_LIBTOOL dnl Check for pkgconfig first AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) AC_PATH_PROG(PKG_CONFIG, pkg-config, no) dnl Check for gtk-doc GTK_DOC_CHECK(1.9) dnl Give error and exit if we don't have pkgconfig if test "x$HAVE_PKGCONFIG" = "xno"; then AC_MSG_ERROR(you need to have pkgconfig installed !) fi AC_PREFIX_DEFAULT([$(pkg-config --variable=prefix libnemo-extension || echo /usr)]) dnl ************************************************** dnl * Check for Python dnl ************************************************** AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) AM_CHECK_PYTHON_LIBS(,[AC_MSG_ERROR(could not find Python lib)]) if test "`pkg-config --variable=datadir pygobject-3.0`" != "" ; then PYGOBJECT_VERSION=pygobject-3.0 PYGOBJECT_MAJOR_VERSION=3 PYGOBJECT_MINOR_VERSION=0 PYGOBJECT_MICRO_VERSION=0 else PYGOBJECT_VERSION=pygobject-2.0 PYGOBJECT_MAJOR_VERSION=2 PYGOBJECT_MINOR_VERSION=28 PYGOBJECT_MICRO_VERSION=2 fi PYGOBJECT_REQUIRED=$PYGOBJECT_MAJOR_VERSION.$PYGOBJECT_MINOR_VERSION.$PYGOBJECT_MICRO_VERSION AC_DEFINE_UNQUOTED(PYGOBJECT_MAJOR_VERSION,[$PYGOBJECT_MAJOR_VERSION], [PyGObject major version.]) AC_DEFINE_UNQUOTED(PYGOBJECT_MINOR_VERSION,[$PYGOBJECT_MINOR_VERSION], [PyGObject minor version.]) AC_DEFINE_UNQUOTED(PYGOBJECT_MICRO_VERSION,[$PYGOBJECT_MICRO_VERSION], [PyGObject micro version.]) PKG_CHECK_MODULES(NEMO_PYTHON, [$PYGOBJECT_VERSION >= $PYGOBJECT_REQUIRED libnemo-extension >= $NEMO_REQUIRED]) PYGOBJECT_DATADIR=`$PKG_CONFIG --variable=datadir $PYGOBJECT_VERSION` AC_SUBST(PYGOBJECT_DATADIR) NEMO_LIBDIR=`$PKG_CONFIG --variable=libdir libnemo-extension` AC_SUBST(NEMO_LIBDIR) AC_DEFINE_UNQUOTED(NEMO_LIBDIR, "$NEMO_LIBDIR", [Nemo libdir]) dnl --------------------------------- dnl Get nemo extensions directory dnl --------------------------------- NEMO_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnemo-extension` AC_SUBST(NEMO_EXTENSION_DIR) AC_DEFINE_UNQUOTED(NEMO_EXTENSION_DIR, "$NEMO_EXTENSION_DIR", [Nemo' extensions directory]) dnl --------------------------------- dnl Check for gtk-doc dependencies dnl --------------------------------- if test "${enable_gtk_doc}" != no; then dnl Check for xsltproc AC_PATH_PROG([XSLTPROC], [xsltproc]) if test -z "$XSLTPROC"; then echo " disabling generation of docs" enable_gtk_doc=no fi fi AC_OUTPUT([ Makefile examples/Makefile src/Makefile nemo-python.pc docs/Makefile docs/reference/entities.docbook ]) echo echo " nemo-python $VERSION" echo echo " Nemo Prefix: ${prefix}" echo " PyGObject Version: ${PYGOBJECT_VERSION}" echo " Documentation: ${enable_gtk_doc}" echo nemo-python-3.6.0+sylvia/ChangeLog0000644000175000017500000000016213173636707016010 0ustar fabiofabioThe ChangeLog file is no longer used. For a list of changes goto: http://git.gnome.org/browse/nemo-python/log/ nemo-python-3.6.0+sylvia/.pc/0000755000175000017500000000000013173636707014717 5ustar fabiofabionemo-python-3.6.0+sylvia/autogen.sh0000755000175000017500000000045213173636707016241 0ustar fabiofabio#!/bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. PKG_NAME="nemo" which gnome-autogen.sh || { echo "You need to install gnome-common from GNOME Git (or from" echo "your OS vendor's package manager)." exit 1 } USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh nemo-python-3.6.0+sylvia/m4/0000755000175000017500000000000013173636707014557 5ustar fabiofabionemo-python-3.6.0+sylvia/m4/python.m40000644000175000017500000001141313173636707016342 0ustar fabiofabio## this one is commonly used with AM_PATH_PYTHONDIR ... dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) dnl Check if a module containing a given symbol is visible to python. AC_DEFUN([AM_CHECK_PYMOD], [AC_REQUIRE([AM_PATH_PYTHON]) py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ ifelse([$2],[], [prog=" import sys try: import $1 except ImportError: sys.exit(1) except: sys.exit(0) sys.exit(0)"], [prog=" import $1 $1.$2"]) if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC then eval "py_cv_mod_$py_mod_var=yes" else eval "py_cv_mod_$py_mod_var=no" fi ]) py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` if test "x$py_val" != xno; then AC_MSG_RESULT(yes) ifelse([$3], [],, [$3 ])dnl else AC_MSG_RESULT(no) ifelse([$4], [],, [$4 ])dnl fi ]) dnl a macro to check for ability to create python extensions dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) dnl function also defines PYTHON_INCLUDES AC_DEFUN([AM_CHECK_PYTHON_HEADERS], [AC_REQUIRE([AM_PATH_PYTHON]) AC_MSG_CHECKING(for headers required to compile python extensions) dnl deduce PYTHON_INCLUDES py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" if test "$py_prefix" != "$py_exec_prefix"; then PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" fi AC_SUBST(PYTHON_INCLUDES) dnl check if the headers exist: save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" AC_TRY_CPP([#include ],dnl [AC_MSG_RESULT(found) $1],dnl [AC_MSG_RESULT(not found) $2]) CPPFLAGS="$save_CPPFLAGS" ]) # The AC_MULTILIB macro was extracted and modified from # gettext-0.15's AC_LIB_PREPARE_MULTILIB macro in the lib-prefix.m4 file # so that the correct paths can be used for 64-bit libraries. # dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_MULTILIB creates a variable libdirsuffix, containing dnl the suffix of the libdir, either "" or "64". dnl Only do this if the given enable parameter is "yes". AC_DEFUN([AC_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. The current dnl practice is that on a system supporting 32-bit and 64-bit instruction dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit dnl libraries go under $prefix/lib. We determine the compiler's default dnl mode by looking at the compiler's library search path. If at least dnl of its elements ends in /lib64 or points to a directory whose absolute dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the dnl default, namely "lib". enable_lib64="$1" libdirsuffix="/i386-linux-gnu/" searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test "$enable_lib64" = "yes" -a -n "$searchpath"; then save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) libdirsuffix=64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) libdirsuffix=64 ;; esac ;; esac case "$searchdir" in /lib/x86_64-linux-gnu/ | /lib/x86_64-linux-gnu ) libdirsuffix=/x86_64-linux-gnu ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in /lib/x86_64-linux-gnu ) libdirsuffix=/x86_64-linux-gnu ;; esac ;; esac fi done IFS="$save_IFS" fi AC_SUBST(libdirsuffix) ]) dnl a macro to check for ability to embed python dnl AM_CHECK_PYTHON_LIBS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) dnl function also defines PYTHON_LIBS AC_DEFUN([AM_CHECK_PYTHON_LIBS], [AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) AC_MSG_CHECKING(for libraries required to embed python) dnl deduce PYTHON_LIBS py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` AC_MULTILIB(yes) if test "x$PYTHON_LIBS" = x; then PYTHON_LIBS="-L${py_prefix}/lib${libdirsuffix} -lpython${PYTHON_VERSION}" fi if test "x$PYTHON_LIB_LOC" = x; then PYTHON_LIB_LOC="${py_prefix}/lib${libdirsuffix}" fi AC_SUBST(PYTHON_LIBS) AC_SUBST(PYTHON_LIB_LOC) dnl check if the headers exist: save_LIBS="$LIBS" LIBS="$LIBS $PYTHON_LIBS" AC_TRY_LINK_FUNC(Py_Initialize, dnl [LIBS="$save_LIBS"; AC_MSG_RESULT(yes); $1], dnl [LIBS="$save_LIBS"; AC_MSG_RESULT(no); $2]) ]) nemo-python-3.6.0+sylvia/m4/lt~obsolete.m40000644000175000017500000001375613173636707017407 0ustar fabiofabio# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) nemo-python-3.6.0+sylvia/m4/ltsugar.m40000644000175000017500000001042413173636707016503 0ustar fabiofabio# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) nemo-python-3.6.0+sylvia/AUTHORS0000644000175000017500000000022713173636707015310 0ustar fabiofabionemo-python is written by Johan Dahlin Somewhat on nemo-mono by: Dave Camp Calvin Gaisford nemo-python-3.6.0+sylvia/README0000644000175000017500000000121613173636707015117 0ustar fabiofabiolibnemo-extension Python bindings ==================================== These are unstable bindings for the Nemo extension library. For examples and documentation check the examples sub directory. As of nemo-python 0.7.0, scripts are also loaded from $XDG_DATA_DIR/nemo-python/extensions, which includes ~/.local/share and /usr/share (or whatever your $XDG_DATA_DIR is set to). Try to copy test.py to that directory for an example Requirements ============ Nemo 1.0.3 Python 2.3 PyGObject 2.28.0 Problems ======== It's currently not possible to reload the python file without restarting nemo. That's a planned feature for future versions nemo-python-3.6.0+sylvia/Makefile.am0000644000175000017500000000035113173636707016272 0ustar fabiofabioACLOCAL_AMFLAGS = -I m4 SUBDIRS = src examples if ENABLE_GTK_DOC SUBDIRS += docs endif pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = nemo-python.pc EXTRA_DIST = nemo-python.pc.in DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc nemo-python-3.6.0+sylvia/examples/0000755000175000017500000000000013173636707016055 5ustar fabiofabionemo-python-3.6.0+sylvia/examples/block-size-column.py0000644000175000017500000000124513173636707021766 0ustar fabiofabioimport os import urllib from gi.repository import GObject, Nemo class ColumnExtension(GObject.GObject, Nemo.ColumnProvider, Nemo.InfoProvider): def __init__(self): pass def get_columns(self): return Nemo.Column(name="NemoPython::block_size_column", attribute="block_size", label="Block size", description="Get the block size"), def update_file_info(self, file): if file.get_uri_scheme() != 'file': return filename = urllib.unquote(file.get_uri()[7:]) file.add_string_attribute('block_size', str(os.stat(filename).st_blksize)) nemo-python-3.6.0+sylvia/examples/open-terminal.py0000644000175000017500000000276713173636707021215 0ustar fabiofabio# This example is contributed by Martin Enlund import os import urllib from gi.repository import Nemo, GObject, GConf TERMINAL_KEY = '/desktop/gnome/applications/terminal/exec' class OpenTerminalExtension(Nemo.MenuProvider, GObject.GObject): def __init__(self): self.client = GConf.Client.get_default() def _open_terminal(self, file): filename = urllib.unquote(file.get_uri()[7:]) terminal = self.client.get_string(TERMINAL_KEY) os.chdir(filename) os.system('%s &' % terminal) def menu_activate_cb(self, menu, file): self._open_terminal(file) def menu_background_activate_cb(self, menu, file): self._open_terminal(file) def get_file_items(self, window, files): if len(files) != 1: return file = files[0] if not file.is_directory() or file.get_uri_scheme() != 'file': return item = Nemo.MenuItem(name='NemoPython::openterminal_file_item', label='Open Terminal' , tip='Open Terminal In %s' % file.get_name()) item.connect('activate', self.menu_activate_cb, file) return item, def get_background_items(self, window, file): item = Nemo.MenuItem(name='NemoPython::openterminal_item', label='Open Terminal Here', tip='Open Terminal In This Directory') item.connect('activate', self.menu_background_activate_cb, file) return item, nemo-python-3.6.0+sylvia/examples/update-file-info-async.py0000644000175000017500000000106513173636707022674 0ustar fabiofabiofrom gi.repository import Nemo, GObject class UpdateFileInfoAsync(GObject.GObject, Nemo.InfoProvider): def __init__(self): pass def update_file_info_full(self, provider, handle, closure, file): print "update_file_info_full" gobject.timeout_add_seconds(3, self.update_cb, provider, handle, closure) return Nemo.OperationResult.IN_PROGRESS def update_cb(self, provider, handle, closure): print "update_cb" Nemo.info_provider_update_complete_invoke(closure, provider, handle, Nemo.OperationResult.FAILED) nemo-python-3.6.0+sylvia/examples/submenu.py0000644000175000017500000000246413173636707020113 0ustar fabiofabiofrom gi.repository import Nemo, GObject class ExampleMenuProvider(GObject.GObject, Nemo.MenuProvider): def __init__(self): pass def get_file_items(self, window, files): top_menuitem = Nemo.MenuItem(name='ExampleMenuProvider::Foo', label='Foo', tip='', icon='') submenu = Nemo.Menu() top_menuitem.set_submenu(submenu) sub_menuitem = Nemo.MenuItem(name='ExampleMenuProvider::Bar', label='Bar', tip='', icon='') submenu.append_item(sub_menuitem) return top_menuitem, def get_background_items(self, window, file): submenu = Nemo.Menu() submenu.append_item(Nemo.MenuItem(name='ExampleMenuProvider::Bar2', label='Bar2', tip='', icon='')) menuitem = Nemo.MenuItem(name='ExampleMenuProvider::Foo2', label='Foo2', tip='', icon='') menuitem.set_submenu(submenu) return menuitem, nemo-python-3.6.0+sylvia/examples/README0000644000175000017500000000066013173636707016737 0ustar fabiofabioTo try any of the examples, copy them over to: $XDG_DATA_DIR/share/nemo-python/extensions/ or: ~/.local/share/nemo-python/extensions/ FYI, it is still possible to load plugins from the old locations. Then restart nemo. Hint: if you're testing an extension that you're developing, it may be useful to start a 'private' instance of nemo, like this: $ mkdir /tmp/testing $ export TMPDIR=/tmp/testing $ nemo --no-desktop nemo-python-3.6.0+sylvia/examples/background-image.py0000644000175000017500000000225513173636707021632 0ustar fabiofabiofrom gi.repository import Nemo, GObject, Gio SUPPORTED_FORMATS = 'image/jpeg', 'image/png' BACKGROUND_SCHEMA = 'org.gnome.desktop.background' BACKGROUND_KEY = 'picture-uri' class BackgroundImageExtension(GObject.GObject, Nemo.MenuProvider): def __init__(self): self.bgsettings = Gio.Settings.new(BACKGROUND_SCHEMA) def menu_activate_cb(self, menu, file): if file.is_gone(): return self.bgsettings[BACKGROUND_KEY] = file.get_uri() def get_file_items(self, window, files): if len(files) != 1: return file = files[0] # We're only going to put ourselves on images context menus if not file.get_mime_type() in SUPPORTED_FORMATS: return # Gnome can only handle file: # In the future we might want to copy the file locally if file.get_uri_scheme() != 'file': return item = Nemo.MenuItem(name='Nemo::set_background_image', label='Use as background image', tip='Set the current image as a background image') item.connect('activate', self.menu_activate_cb, file) return item, nemo-python-3.6.0+sylvia/examples/location-widget-provider.py0000644000175000017500000000045213173636707023351 0ustar fabiofabiofrom gi.repository import Nemo, Gtk, GObject class LocationProviderExample(GObject.GObject, Nemo.LocationWidgetProvider): def __init__(self): pass def get_widget(self, uri, window): entry = Gtk.Entry() entry.set_text(uri) entry.show() return entry nemo-python-3.6.0+sylvia/examples/Makefile.am0000644000175000017500000000050213173636707020106 0ustar fabiofabiodocsdir = $(docdir) docs_DATA = README examplesdir = $(docdir)/examples examples_DATA = \ background-image.py \ block-size-column.py \ location-widget-provider.py \ open-terminal.py \ md5sum-property-page.py \ submenu.py \ update-file-info-async.py EXTRA_DIST = README $(examples_DATA) nemo-python-3.6.0+sylvia/examples/md5sum-property-page.py0000644000175000017500000000242013173636707022433 0ustar fabiofabioimport hashlib import urllib from gi.repository import Nemo, Gtk, GObject class MD5SumPropertyPage(GObject.GObject, Nemo.PropertyPageProvider): def __init__(self): pass def get_property_pages(self, files): if len(files) != 1: return file = files[0] if file.get_uri_scheme() != 'file': return if file.is_directory(): return filename = urllib.unquote(file.get_uri()[7:]) self.property_label = Gtk.Label('MD5Sum') self.property_label.show() self.hbox = Gtk.HBox(homogeneous=False, spacing=0) self.hbox.show() label = Gtk.Label('MD5Sum:') label.show() self.hbox.pack_start(label, False, False, 0) self.value_label = Gtk.Label() self.hbox.pack_start(self.value_label, False, False, 0) md5sum = hashlib.md5() with open(filename,'rb') as f: for chunk in iter(lambda: f.read(8192), ''): md5sum.update(chunk) f.close() self.value_label.set_text(md5sum.hexdigest()) self.value_label.show() return Nemo.PropertyPage(name="NemoPython::md5_sum", label=self.property_label, page=self.hbox), nemo-python-3.6.0+sylvia/nemo-python.pc.in0000644000175000017500000000023213173636707017442 0ustar fabiofabioName: Nemo-Python Description: Nemo-Python Components Version: @VERSION@ prefix=@prefix@ libdir=${prefix}/lib pythondir=@datadir@/nemo-python/extensions nemo-python-3.6.0+sylvia/NEWS0000644000175000017500000000000013173636707014724 0ustar fabiofabio