Change module __version__ and save the module source file with updated version afterwards


In all of my Python module files I put the module version with
__version__.


Now if I release my Python
library, I want to increase this module version inside all Python
module files automatically.


I know that I can access the
version of a module for reading like this:

/>

mymodule.py:


# my module
__version__ =
"0.0.1"

usesmymodule.py:


import
mymodule
# Gives me "0.0.1"
print mymodule.__version__ />

Now how can I save the module source file after I
changed its version? In a way like this:


I am using IntelliJ 11.1.3, IvyIDEA Plugin for
IntelliJ
, Spock 0.5 (which depends on Groovy
1.8.4
), and Groovy 1.5.6.


I have an
IntelliJ module that follows Maven Standard Directory Layout. The
output is a WAR file.


When doing a build of this module in
IntelliJ, is there any way that I can tell IntelliJ to use the
following:


Groovy 1.5.6 to compile
src/main/groovy
Groovy 1.8.4 to
compile src/test/groovy

I need to do this because
the actual application code needs to be compiled ag

Programming Languages

I want to rotate the location where temporary files are written
however it is my understanding that the PHP script wont execute until
after the full post is already completed. By that time the file is
already written to the default temp location from the configuration
file which is loaded in at the time apache is spawned and the php
module is loaded. Any ideas?

PHP

I have a variable in my main module which is changed using another
module, but I want to change the variable from my main module through
another module. I'm new to programmering, so I actually don't really
know how to explain this stuff - sorry if I'm asking a stupid
question.


The program's hierarchy looks a bit like
this:


Main

---Features />
---Pygame_handling

------Features


I use the
"Features" module to change a variable in the "Main". I do this simply
by getting the defined variable from "Features". But when I change the
variable through "Pygame_handling", it is not changed in the
"Features" object

Programming Languages

although there are some related threads according to find the
source file of a python module, I did not find an answer on how to get
the filename from within a python class in a most simple and reliable
way. For a hypothetical file located at
/usr/local/TestLib.py:


class
MyTest(object):
def __init__(self):
myLocation =
XXX

I want the variable myLocation
to contain the string /usr/local/TestLib.py.
__file__ does not seem to work inside my class. Any
suggestions?


Thanks
Alex

Programming Languages

In all of my Python module files I put the module version with
__version__.


Now if I release my Python
library, I want to increase this module version inside all Python
module files automatically.


I know that I can access the
version of a module for reading like this:

/>

mymodule.py:


# my module
__version__ =
"0.0.1"

usesmymodule.py:


import
mymodule
# Gives me "0.0.1"
print mymodule.__version__ />

Now how can I save the module source file after I
changed its version? In a way like this:

Programming Languages

If I try to use the shell I get this API conflict.

/>/home/username/.python-eggs/MySQL_python-1.2.3c1-py2.6-linux-i686.egg-tmp/_mysql.so:6:
RuntimeWarning: Python C API version mismatch for module _mysql: This
Python has API version 1012, module _mysql has version 1013. />

I'm running:
Python 2.6
MySQL Server version:
5.0.77
MySQL_python-1.2.3c1


I tried unsuccessfully to
update to a new version of MySQL-python.


easy_install-2.6
-d ~/lib/python2.6 MySQL-python


Searching for
MySQL-python
Best match: MySQL-python 1.2.3c1
Processing MyS
Databases

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow