module

Python - Assign global variable to function return requires function to be global?

So, I'm confused. I have a module containing some function that I use in another module. Imported like so: from <module> import * Inside my module, there exist functions whose purpose is to set global variables in the main program. Some of the global variables need to be assigned to the output of another function in that same module....

How to import all submodules?

I have a directory structure as follows: | main.py | scripts |--| __init__.py | script1.py | script2.py | script3.py From main.py, the module scripts is imported. I tried using pkgutils.walk_packages in combination with __all__, but using that, I can only import all the submodules directly under main using from scripts import...

How to prevent 'finished' GWT-modules from recompiling when deploying to GAE?

Is there something I can do to not have all my modules recompiled every time I hit 'Deploy to GAE'? (Like when I don't touch GWT or client-side at all.) It would be nice to see 'module not modified, skipping...' sometimes, instead of 'compiling 12 permutations, go get me a coffee...'. ...

get values from form API checkboxes

This is a module that I'm working on to create a custom filtered search. But i have no idea on getting the values of form type checkboxes... I searched but nothing yet! <?php function my_module_menu() { $items = array(); $items['my_module/form'] = array( 'title' => t('My form'), 'page callback' => 'my_module_form', 'acc...

.py to .exe, three questions

I want to package a Python script so that it can run as a standalone program on Windows XP and later Windows versions. Now to do this I'm pretty sure I'll have to convert it to an .exe file. I know methods exist, what is the easiest/best method? Now this is where the question gets a little more advanced. I also have some modules the p...

Modifying devel module

I'm trying to modify devel generate module to prevent it from generating content by users who don't have the permission to generate this content type. Problem is I'm fairly new to drupal so I'm not familiar with its hooks. Can someone give me some hints how to approach this. http://ftp.drupal.org/files/projects/devel-6.x-1.20.tar.gz ...

Drupal: Edit email template from contact form

When submitting a message in my site-wide contact form in Drupal 6.x I get the following message along the top of every message: [Name] sent a message using the contact form at [www.mysite.com/contact] I would like to remove this message. Looking around, I've found it comes from the contact.module here: $message['body'][] = t("!name ...

view drupal nodes which are referenced in another node

I have a node which references other nodes. If I give a user custom access to this node, how do I set it up so that he automatically gets access to those other nodes as well? ...

Confused how to import modules in python

If I want to use a 3rd party module like a python s3 module (boto http://boto.s3.amazonaws.com/index.html) or http://developer.amazonwebservices.com/connect/entry.jspa?externalID=134. Once I download the .py files, what do I do? Where does the python interpreter look when I import a module? Is there a 'lightweight' way of installing a...

How to register custom module manager in PRISM?

Hi, I've created some simple custom ModuleManager in my silverlight application based on PRISM. I also registered this type in bootstrapper, but PRISM still use the default manager. The constructor of my CustomModuleManager is called, but the property ModuleTypeLoaders is never accessed. I can't figure it out, how can I make it work prop...

How to load modules with an iteration and execute a method in RUBY

Hello, i would like to load modules dynamically and execute a method for each module loaded: The modules are in a directory called modules/ modules/ModA.rb module ModA def run puts "module A" end end modules/ModB.rb module ModB def run puts "module B" end end Main.rb class Main def start Dir.glob("modules...

Python - difference between os.access and os.path.exists?

def CreateDirectory(pathName): if not os.access(pathName, os.F_OK): os.makedirs(pathName) versus: def CreateDirectory(pathName): if not os.path.exists(pathName): os.makedirs(pathName) I understand that os.access is a bit more flexible since you can check for RWE attributes as well as path existence, but is th...

advice on storing 3rd party modules on my computer

How do you guys go about storing your python modules locally? And how do you then go about referencing them in your python scripts? Should I do this? /home/python/modules And then create a sub-directory for each module, like say the amazon s3 module: /home/python/modules/amazon-s3/s3.py Now I have to somehow tell python to look a...

Stop module loading

Hi Guys! I'd like to stop the loading of a module if some modules dependencies arent on machine, how can i do that? try: import lxml except: print "This module requires lxml" # WHAT SHOULD I PUT HERE TO STOP MODULE LOADING? class foo: pass ...

Dynamic methods in a Module?

I've got a module called AB. Right now it looks something like this: module AB extend self def some_method(hash) .... end .... end We use it like this: AB.some_method(:thing=>:whatever,:etc=>'you get the idea'). There are about a half-dozen strings that the user has to pass in that I'd like to turn into dynam...

What to put in "type" when adding new content to node via $node->content

I'm adding new content to a node, but I'm stuck on what to put in #type. I know that when you're dealing with a profile page for example, you would put '#type' => 'user_profile_item' but what to put for new content on a node? $node->content['newc'] = array( '#type' => , //what to put here for type '#title' =>...

Giving public access to root directory of svn

Hello, i was wondering if it is possible to let people access subversion root directory trough apache and 'dav_svn' module. Now i can only access only repositories that are 1 level lover than root directory ("svn/game" "svn/something" but not "svn/"). My httpd.conf: <Location /svn> DAV svn SVNParentPath C:/SVN AuthzSVNAccess...

How to judge whether a Constant has been defined within a module namespace, not a global one?

I have two Const with the same name; One is a global const, and the other is defined under the namespace Admin. But I need to distinguish them;The global one has already defined, and the scoped one need to auto defined if it has not been defined yet: A = 'A Global Const' module Admin A = 'A Const within the Admin namespace' if...

How can a class method (inside a module) update an instance variable?

How can a class method (inside a module) update an instance variable? Consider the code bellow: module Test def self.included(klass) klass.extend ClassMethods end module ClassMethods def update_instance_variable @temp = "It won't work, bc we are calling this on the class, not on the instance." puts "How can I ...

how to install bcmath mdoule?

how to install bcmath module on a server? I tried yum update php-bcmath but it said it found nothing. please advise. ...