No appointed officer or employee of the city shall in any manner contribute to, participate in, or take part in any election, primary or any political contests, other than by exercising his right to vote; provided, the foregoing prohibitions shall apply only to those elections, primaries or political contests for offices of the city. Any person violating the provisions of this Section shall be punishable as for violation of a city ordinance.